Chances of getting into trouble are very low unless you find yourself in an accident.
You can always replace motor to make it legal, but personally wouldn't bother. Problem is there are almost no available cargo bikes on the market to convert. You would have to hunt for a long time to find...