Auxiliary particle theory of threshold singularities in photoemission and X-ray absorption spectra