These are the connectors that you cab get from Ebay.
Find great deals on eBay for Jst-Sm 3-Pin 2.5mm. Shop with confidence.
www.ebay.co.uk
You have a choice on how to fix it. You can buy the connector block and pins, then use thin pliers to crimp the pins to the wires and insert into the block. It's a bit fiddly, but that's what I normally do. After a lot of practice, I can get good crimps.
Alternatively, you can buy the connector with the leads already attached, cut the leads a couple of inches from the connector, then solder the wires together and insulate with thin heat-shrink tube. That's what I do when I'm in a hurry.
Finally, this is how I do it on my own bikes. cut off the connectors, solder the wires together and insulate with heat-shrink tube. That's the cheapest, quickest and most reliable way to do it. In all probability, you'll never want or need to separate the wires again, but in the unlikely circumstances that you did, it takes one second to cut them, which is quicker than disconnecting, then you can resolder them to reconnect.
Whatever solution you use, the colours go brown to red, black to black and yellow to white.