Generalization error of mean-field shallow neural network