I have carried a spare Kenevo battery, which is a big heavy lump, in a backpack, but I pack spare clothes around it and when I take it I’m doing rides which I’m pretty confident I won’t fall off - I wouldn’t be taking big jumps in a park park!
Electrically? It is a TEC pack for the wife. She has a Bold2 XS. I would put it upside down in the frame bag. The battery is missing the bottom half with the mounting plate.
If you insulate all the bare lipo battery ends with something appropriate, electrical tape for instance, and then maybe wrap the whole thing again to ensure no parts can move, then it should be safe. Check the cells for any physical damage beforehand though, if any are dented or swollen, don’t use it.
If it’s in a frame bag with the wire poking out, waterproofing the bag and cable entry/exit point might be the biggest challenge.
Maybe look at fashioning a half case out of some plastic guttering or similar to make it more of a hard pack case?