Machine learning reveals hidden components of X-ray pulses