Transition radiation detectors for particle physics and astrophysics