There is no script to pretrain BERT in the examples, transformers is primarily there to help you finetune a model like BERT on a downstream task.
That being said, the DataCollatorForLanguageModeling 141 masks random tokens when creating batches, if you need it.