Generalization-RL Based on Learning Invariances for Policy Generalization and Contrastive Behavioral Similarity Embeddings