Laying the Foundation First? Investigating the Generalization from Atomic Skills to Complex Reasoning Tasks