Text this: Detecting phase transitions in collective behavior using manifold's curvature