You could create a behavior that has a periodic effect to add another behavior,
Behavior: "Ramming" periodic 1s, effect add behavior "charges"
the behavior that checks if the unit is moving or not should always be on, then add or remove charges accordingly
have a high max stack count on charges, have these charges increase the damage of the weapon, have a validator in the "apply behavior" effect that checks to see if the unit is moving.
You could also use a switch effect that checks if unit is moving, add behavior, if unit is stopped, remove all behaviors.
Though, if you want it to count powerslides and stuff you may need to trigger in a dummy behavior that can be used to check for if the moving validator fails, so it will still charge the ramming while sliding.
Alternatively, you could also use the "charging" buff like acceleration, and have the buff not only increase weapon damage but speed as well, to more accurately reflect momentum. Though if you use a trigger base, you can probably grab exact speed and set the stack count based on that.