How do x-rays help determine a celestial body's temperature?
X-rays by themselves do not, the entire light spectrum does.
The heat that a luminous body emits is directly related to its temperature. Hot objects emit more of their light at short wavelengths, and cold objects emit more of their light at long wavelengths.
As we know, wavelengths are inversely proportional to energy present, that's why a shorter wavelength have more energy and heated objects emit that.
Whereas, cold objects have less energy but longer wavelengths.