Contrastive Learning of Generalized Game Representations