Latent Skill Discovery for Chain-of-Thought Reasoning