I know you can just buy "milk crates" online or in some stores. I used one of the store bought ones on an electric scooter I had years ago.
But I have seen plenty of people with the actual ones from a dairy company, and never heard of anyone being stopped by the cops for having it on a bike.
I have also seen them laying on the side of the road before, so even if you did have one on your bike, and got asked about it by a cop, you can probably just say you found it on the side of the road and it would be believable.
Sterilite Plastic Storage Crate, Black https://www.amazon.com/dp/B0001ACQQA/ref=cm_sw_r_cp_apip_8kHi5P61PoWL7