I want to add the glue also helps inhibit cold solder joints from arising with vibration of the transformer or movement on the harness. Kind of a double duty for the application of glue or silicone in most circuits and near harnesses, jacks and other components that can receive stress in movement.
The Glue on the ribbon cable is an extra restraint to supply support when handling the board or harness while assembling or disassembling the unit.
On the opposite side glue surrounds a power transformer used in the DC circuit to subdue vibrational noise or hum from the resonant frequency of the component.