You could adapt the save_checkpoint method from the ImageNet example 1 to store a checkpoint for each epoch.
Note that in order to continue the training from a checkpoint you should at least store the state_dicts of the model as well as the optimizer.