A spline broach used on a rifling bench would be the likely method. The rifling bench is a long table with workholding features at one end and a helical cam (helix geometry matching the rifling twist) to mount and guide the broach at the other.
There will be a twist in the rifling – the purpose of the rifling is to get the projectile to spin during flight, which stabilises it.
I'm not any sort of gun expert – the above is the sum of my expertise on rifling.
JD