Replacing the top case on a UPS, danger of electromagnetism?
The hum is usually caused by magnetorestriction of the transformer laminations.
Over time the pressure on the laminations will reduce, and you can get oxidation between the laminations allowing them to move relative to one another easier (Hum) than when new.
The transformer also has an external magnetic field and your top cover represents a magnetic short which will alter the field concentrations and paths slightly. When you take the top away the field lines move and the magnetorestrictive field paths move too. This movement now impacts slightly different spots in the laminations, so 'Hum' may actually increase or decrease. 
Perhaps you could read this as an introduction. 

I've seen various techniques used to reduce hum.  


Audio transformers used to have strong steel clamps on the ('E' and 'I' side laminations) along with a front and back cover.    
Copper covers used to encase transformers and short the external field.
Complete vacuum potting to restrict laminations and bobbin wires moving and to suppress noise transmission 


In your case you might be able to impact (reduce) the noise by replacing the fiber, hard rubber or like washers used in the lamination clamps as they normally spread (flow) with time and reduce the pressure on the laminations.

Replacing the top cover with a non-magnetic material may buy you some more quiet time, but invariably the Hum will eventually return.