Generalization Error of Graph Neural Networks in the Mean-field Regime