Advancing Generalization in PINNs through Latent-Space Representations