That's not how motors work and neither is it how the law works.
The law says that the motor must be rated at no more than 250w. Rating is done by the motor manufacturer and cannot be changed by the way you use it. The rating must be marked on the motor by a label or stamping. You cannot run a 500w motor at even 10w to be legal. A motor rated at 500w is illegal, and that's it.
Regardless of the motor's rating, the power that it gives depends on the circumstances, not how much power you let the battery give it. The power that you give the motor obviously affects how much power you can get out, but it's not the whole story.
Ebike motors have a power curve that depends on RPM. The torque is more or less proportional to the current, so the torque curve is fairly flat, but the power = torque x rpm, so the it increases with rpm up to the point where the back emf starts to limit the current more than the controller does, then both the torque and power ramp down to zero when the back emf is the same as the battery voltage.
The changing power in the different circumstances is the reason, that the law can't tie down the maximum power that the motor makes, so uses the rated power instead. If you give a hub-motor 250w from the battery, you'd get about 100w from it when climbing a hill slowly and about 175w when breezing along at 15 mph, assuming it's a motor designed for the UK ebike market. You need around 400w from the motor to get meaningful help up a hill, i.e. enough to keep you pedalling at around 8mph.