Microsoft 365 features that help users manage their subscriptions, account settings, and billing information.
There is no method available to move a Microsoft 365 subscription to another account.
You will first need to backup all your files that may be stored on OneDrive online to ensure against data loss because you will loose access to that OneDrive account, then ask your friend to cancel the Microsoft 365 subscription on their account and then take out a new Microsoft 365 subscription on your own Microsoft account.