Representations Shape Weak-to-Strong Generalization: Theoretical Insights and Empirical Predictions