from transformers import PushToHubCallback
push_to_hub_callback = PushToHubCallback(
     output_dir="./your_model_save_path", tokenizer=tokenizer, hub_model_id="your-username/my-awesome-model"
 )

Add the callback to fit, and 🤗 Transformers will push the trained model to the Hub:

model.fit(tf_train_dataset, validation_data=tf_validation_dataset, epochs=3, callbacks=push_to_hub_callback)