It's either a shore power charger or an alternator charger. The purple wire coming out of it makes me think it's an alternator charger, so it knows when the engine is on and it can start charging the batteries.
Look on the batteries for the same colored wires and fuses. See where the purple wire goes and ditchpickle98 might be right.
Next time when on the water and engine is running check to see the red light is on and check voltage at trolling motor batteries.
Jerry has got it I think. There is one on my boat. It would cut off power to my trolling motor when the ignition was turned on. May be a type of DC to DC charger by the smaller fused wires that connected to the batteries.