I tye-wrap it to the fork, on the top. Mine is on the front fork. 10000 miles I haven't broken the motor connector yet. There is split tube pvc cable wrap , but the 1" diameter size you have to buy a whole roll somewhere. The 1 cm size is sold at any auto supply in the wiring section. This 32 mm diameter sleeve is only $52 for a 50 m roll https://www.newark.com/multicomp/pp001374/hookloop-braided-wrap-pe-50m/dp/18AC8205?st=cable wrap
Newer hubs have a 11 pin juli connector, which is pretty rugged. My older motors have the 6 pin plastic rectangular connector on the hall effect sense wires, and three .157" bullet connectors on the phase wires.