Neither the model nor the optimizer use the epoch or batch count.
It’s up to you to store and load the model checkpoints.
The model and optimizer just use .load_state_dict() to restore their parameters.
If you can work with epoch + minibatch, it’s fine. Alternatively you could somehow store the epoch as a fractal, i.e. for half the mini-batches in the epoch, just save 'epoch': 0.5.