Lossless Transformations and Excess Risk Bounds in Statistical Inference