Federated identity management using Active Directory Federation Services
There is a way to do that.
You can create a backup of your AD FS 2012 R2 farm using this: AD FS Rapid Restore (scenario 3: https://learn.microsoft.com/en-us/windows-server/identity/ad-fs/operations/ad-fs-rapid-restore-tool#scenarios)
Then restore it a chose WID.
Then you can do a regular upgrade (which consist of adding 2022 servers to your existing 2012 R2 farm).