You can do this with a little bit of jQuery
To take the ID and create your H3 text from that...
var newHeading = $(this).attr('id'); //Get the ID
newHeading = newHeading.replace('_', ' '); //Replace the _ with a space
$(this).text(newHeading); //Replace the H3 text with the new heading
...or to take the heading text and generate the ID from that...
var newID = $(this).text(); //Get the H3 text
newID = newID.replace(' ', '_'); //Replace spaces with _
$(this).attr('id', newID); //Attach the new ID
Of course, these both rely on the user having JS and for that reason, you should make sure you have a suitable fall-back for users with JS off