Transmission grating spectrometer for characterization of undulator radiation