Yes, it does, and there are 2 possibilities to back up your codes/tokens in an encrypted way.

The first one is a manual backup (local iTunes backup). It’s done by connecting your phone to a computer with macOS and doing a backup of everything, including 2FAS, there.

The second one is, if you have iCloud backup turned on from your phone settings, then 2FAS is stored there and will be restored automatically. However, we also recommend using our own iCloud Sync option.