From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamics