i dont know what your software availability is, but i know the warp stabilizer in Premiere and After Effects does what you are describing in many cases. there is really no way to fix this using the effect itself, with the exception of changing the options for smoothness and changing type of stabilization from warp to position, or vice-versa.
the only way to get a good stabilization of the type of movement you are describing, outside of actually stabilizing your camera better in the first place is to use motion tracking, such as in After Effects. It will allow you to track the point of motion you want to keep steady, and then it will use that data to keyframe motion, keeping your tracked point centered. you would then manually scale the clip until it is completely framed with no cropping. additionally, in the case of trying to stabilize a motion shot, such as that from a camera slider, you would keyframe the motion to recreate the linear movement you originally captured via the slider. otherwise, you would end up with a clip that begins cropped on one side of the action and ends cropped on the other.