Quantifying and Improving Transferability in Domain Generalization