Beyond Distribution Shift: Spurious Features Through the Lens of Training Dynamics