The trick is to design the circuit so that the turn signal will continue to flash when you are both braking and turning at the same time.
One way is to use a exclusive-or gate function. You can use an electronic digital XOR gate for this. Alternately you can do this with a relay driving the light, by connecting one of the coil connections to the brake light and the other coil connection to the turn signal (you need two relays, one for each direction). Thus when either the turn signal or the brake light is on, the relay (and the light) is on. When both are off or both are on the relay is off. Note that when the brake is applied, the rear turn signal light will be out of phase with the front turn signal (or any turn signal not connected to the relay).
Also note that the one requirement for this to work is that there be a path to ground for the relay coil current to the side that isn't on. If there is no other bulb in the circuit to provide that path, you will have to add a resistor or bulb to ground of appropriate value and power rating.