I think there are some atlas packers that solve this by automatically cropping them and storing the center offset in the atlas data for every single image. Obviously Defold’s packer isn’t that fancy. Maybe when they add polygon trimming to atlases we will get this.
I can’t think of any way to do it that wouldn’t be very tedious. Though “tedious” depends on how many frames of animation you have. If you only have a few dozen one-frame “animations” like your example then it wouldn’t be hard to make a lua module mapping animation IDs to a center-offset, and add an extra game object to offset the sprite whenever you change animations.
One solution could be to break your sprite into multiple pieces. In your example case, if you made the weapon a separate sprite, then your character body could be cropped a lot closer, and overall you would probably save some space.
But is this really necessary? With low-res pixel art like this, will you end up wasting more than…a megabyte? It depends on the number of animations and your target size.