Somewhere in your wiring loom is a short between wires, the stop lamp power wire and the electric brake power wire. As your truck turns on the signal lights, it's also powering the electric brake(s). See if you can isolate the problem to one or both brakes; if both it's toward the front; if only one it's aft of the split.

Regardless, trailer wiring is usually of low quality and poorly installed. Honestly, your best bet may be to replace the whole shebang...it's not difficult nor that time-consuming...

Discussions on interior lighting and supplemental battery installs can be quite time-consuming and are best done over beers...but we just went through that so we can offer some advice.

Fix the basics, first.