If you managed to get temporary root (rare on locked bootloaders), you can use Flashify to permanently flash the Magisk patched image.