Currently, activitypub identity is tied to domain name. Mastodon support migration as long as the old domain is still up during the migration process, but AFAIK Lemmy doesn’t even have a process to migrate an instance to a new domain yet.
Someone should tell Lemmy devs and send them a crate of coffee because it’ll be a race to implement domain migration before all .ml domains got shut down.