Internal Contrastive Learning for Generalized Out-of-distribution Fault Diagnosis (GOOFD) Framework