Minecraft and Microsoft Store licenses are permanently tied to the Microsoft account where the code was redeemed. The context only describes how to redeem codes and does not provide any supported method to move, unlink, or reassign a redeemed game/license from one Microsoft account to another.
Once a Minecraft or Microsoft Store code has been successfully redeemed to an account, that balance or entitlement belongs to that specific account and is non-transferable.
References: