The flow meter will work fine underground. The only issue is if the radio communication will be reliable between the controller and flowmeter if the flowmeter is under a layer of wet dirt. By placing in a plastic landscape box, the radio waves will not be impeded to the extent that would happen with a “buried under wet dirt” transmitter. Radio waves go through plastic just fine, unless the box became flooded with water.
By keeping the controller and flow valve in relatively close proximity to each other, you can ensure the radio communications will work. You can test this BEFORE you do the final installation by setting up the controller and flowmeter in their proposed locations, and running water through the sensor with a garden hose.
If you do not have the flow meter close to the controller and you find it does not communicate reliably, there is still something else you can try. Wrap a wire around the flow meter, and then run that wire to the controller. This wire will NOT be electrically attached to either the flow meter or controller. However, it should work as an accessory antenna to bring the radio signal from the flow sensor to close proximity to the controller, and may allow the sensor to communicate despite being a further distance from the controller than otherwise possible.