The outlet is always hot ... you can simply mount a weatherproof box on the side of a 4x4, as long as you protect the cable by running it in conduit from the trench bottom to the box.
This is a great tip for making your own box-extension out of a single-gang PVC outlet box ... Install a proper “in-use” heavy-duty weatherproof receptacle cover, turn on the power, and ...