Fix epoch number when resuming training
# What does this PR do?

As @stas00 pointed out in #21390, the epoch number reported after skipping some batches in a training resumed was wrong. This PR fixes it and adds a test.
_The documentation is not available anymore as the PR was closed or merged._