Cross-Domain Class-Contrastive Learning: Finding Lower Dimensional Representations for Improved Domain Generalization