Did you define the fit method manually or are you using a higher-level API?
In the former case, you could just copy-paste the saving code into the fit function. In the latter case, I would assume that the library might provide some “on epoch end” - callbacks, which could be used to save the model.