X-ray observation of a transient hemiaminal trapped in a porous network