An Information-Theoretic Framework for Out-of-Distribution Generalization