Tough to say for sure without seeing the other side of the connector, but that looks like a JST XH 2.54mm connector or something very similar, at first glance.
Most of the dynamo lights I've seen were all bare wires as they expect you to crimp/solder them yourself.
Those are super common connectors and lots of sellers who will sell the female mating connector on its own, or as part of a harness with wires pre-crimped.
They have no weather sealing at all and the slightest bit of water will get in there and corrode the connectors, and while a short across the dynamo likely won't hurt it, it's not going to be great for your light output.
https://www.aliexpress.com/item/1005006227337604.htmlIf it was me I'd just cut the end off and solder or waterproof-crimp to the new wires of your replacement light.