I can think of two approaches, neither of them simple.
First, you can build an external box that takes the audio from the headphone output of the MP3 player, passes it through a stereo variable gain amplifier, and amplifies it back up to headphone level. The gain of the amplifier would be controlled based on the volume of the audio coming from the monitoring microphone; you would want some kind of smoothing or hold/release so that a loud noise would increase the output volume quickly but it wouldn't return to normal until the ambient noise had dropped for a short while. This would require quite a few components but it could all be done in the analogue domain.
Second, you could hook a circuit into the volume adjustment system of the MP3 player. That should be possible if the MP3 player's volume is controlled by up and down buttons or a rotary encoder. This would require some experimentation to find out how the MP3 player responds to the volume inputs, and how quickly the volume can be changed. You would probably need a small microcontroller to keep track of the volume setting and issue the up/down commands. The MP3 player might miss commands and get out of step.
Another option, if you only need two or three different volume levels, would be to use the first method, but use relays (e.g. reed relays) and resistors between the MP3's headphone output and the headphones to provide several steps of attenuation. Set the MP3 player to the loudest volume you need, and the resistors would attenuate the signals to a normal listening level. When loud ambient noise is detected, the circuit would close the relays which would bypass the resistors and increase the volume to the headphones. This wouldn't give a smooth change in volume but would be a lot simpler to build.