The difference between nn.Conv2d and nn.Conv3d would be how the additional N dimension is handled in your use case.
The nn.Conv2d layer would interpret N as the channel dimension and each kernel would thus use all channels in the default setup. The sliding windows would be applied in the spatial MxM dimensions.
On the other hand, the nn.Conv3d layer would use the “sliding cube” in the NxMxM dimensions and use a single input channel.
I’m not familiar with your use case and don’t know which approach would make more sense. Since the 3D layer seems to give better results, you could stick to it.