Generalization of Graph Neural Networks through the Lens of Homomorphism