Here I have measured the inside of the box, and made up two chunks of foam to fit.
Then I cut the boat hull shape in the middle,
and finally glue the foam inside in the right position.
The boat bow and stern are held in position with foam off-cuts.
Note that I make my foam supports up to the deck level. Then, if I ever need to, I can put another matching foam piece on top of the boat touching the decks to hold it down, so that if the box is inverted the model will suffer no harm...
You simply assemble by making the sides bend upwards and stick to the flaps with a bit of hot-melt. You may need to trim the lip a little if your cutting is out a bit. I usually re-inforce the sides with a rivet or two once things are cool.