A transition radiation detector to measure the energy of cosmic ray muons in an underground laboratory