Currently, activitypub identity is tied to domain name. While mastodon support migration as long as the old domain is still up during the migration process, AFAIK Lemmy doesn’t even have a process to migrate an instance to a new domain yet.
So basically, if you switch your instance domain, you’ll mess up all your federation network, unless Lemmy devs implement a solution soon.