How to secure an electric motor battery

I'm new to sailing and purchased a Newpot vessels motor for my Scot.  Has anyone ever tried to secure an electric motor battery in the transom of their boat.  Thank you.

I built a platform from plywood and framed it with wood such that it would prevent the battery box from sliding around.I used two more pieces of wood to hold the platform up so that bilge water can flow underneath. I believe I glued it down with some silicone. It's located on the centerline, under the back deck, far enough aft to clear the boom crutch support. The battery is wired to a connector on the transom, near the motor mount.

I was thinking of doing what you suggested but with plastic or vinyl.  Thank you.