You’re right, I did missunderstand your OP.
On the page I linked you can see how to run BERT with any supported head. There is a head for Pretraining, which you can use to continue to pre-train BERT BERT — transformers 4.3.0 documentation 119
If my understanding is correct, this should enable you to do exactly what you want (train both MLM and NSP).