Its a landmine
Not sure it's as much of a problem as you're making it seem though.. likely there can be enough iteration that it would not be distinguishable.
Also lots of mainstream artists ignore copyright anyway (Kanye West etc). Plus you could just use training data that is from public domain stuff if it was really such an issue, there is decades worth of music that are outside of copyright law.
Would distributing a generative model that can sometimes generate such music would also be considered illegal? Will it actually stop people from doing it in practice?
Would it be illegal to share seeds and prompts?
Though these alternative methods, you could have a lot of people listening to music that's never distributed as audio or video files. And if there's an API for it, games could use such generated music via a plugin.
And then I suppose people start sharing on YouTube, and we see how good their copyright violation detection actually is.
Against the law? Maybe, probably. I don't think the laws are as strong as they appear though.
Source on sampling: the head audio engineer at Juilliard School of Music.