The "proper" way would be to set breakpoints on the APU registers ($4015 would probably be the logical choice to monitor as it enables and disables channels?) and do tracing in a debugger to find where the music data is, then reverse engineering how the game is using the APU: There is no driver for sound on the NES, each programmer had complete control of the hardware and most had different ideas of how to generate the music.
A cruder way would be to run FCEUX's Code/Data Logger utility when starting an area of a game where a song begins, then stopping it shortly thereafter. Through trial and error (Randomly changing the green highlighted bytes in FCEUX's Hex Editor, also called Corruption) you will eventually find the data. Then you have to reverse engineer the data format the game is using to generate the songs.
Even with this, you have two problems: If you're trying to put a song from something else into the game, you'll need to transcribe the music to whatever data format the music is stored in. If you're writing original songs, you should probably either play an instrument you can compose on or have a passing knowledge of music theory. Both require actual musical knowledge of some sort (I composed music for NES games on a guitar and bass, then translated them into the format needed).
It's not simple to pull off, but I always had a lot of fun doing it.