I think the training parameter tells the BatchNorm function how to behave, since it should behave different when running inference on the model. The running_mean and running_var parameters are the current mean and variance of the data, that will be updated using:
running_mean = momemtum * running_mean + (1.0 - momentum)  *  batch_mean
running_var = momemtum * running_var + (1.0 - momentum) *  batch_var

I think the reason why the torch.nn.BatchNorm2d does not need these parameters is because since it is a part the model it can keep track of the data the model has “seen” and wheter it is running in training or inference mode.
P.S: I am by no means an expert so take my explanation with a big grain of salt. Cheers
Diego