From Memorization to Reasoning in the Spectrum of Loss Curvature