When OTA is finished installing, before rebooting, head into the Magisk app and install it into the other slot. That is all, you keep root.
You only need to payload_dump the ROM and patch the boot.img if you forget to do that.
You only need to payload_dump the ROM and patch the boot.img if you forget to do that.