Synchronization on circles and spheres with nonlinear interactions