Understanding Attention and Generalization in Graph Neural Networks