How to backup free music on iTunes?

I use an app on my iPhone for free music, and I'm getting a new iPhone. Is there any way for me to backup the music that is on the app so I can have it on my new phone? I've reset my current phone before and I couldn't find a way to do it

J56j656j5