Nonlocal bosonization in two dimensions and an effective string field theory with phase transition