Random thoughts (no code)...
In real life, one targets a vehicle with complex movement by trying to figure out what that movement is so as to anticipate it. If you are writing code for AI to target AI, then you should create a targeting AI that is derived from the target AI. For example, if your target will run for cover if near by, the targeting AI should be able to anticipate this movement.
On the other hand if you are trying to target humans with AI, it's going to be a lot more difficult. Random targeting could work, but may look just "random", which may or may not be an issue for your game.
To come up with a solution, one thing you can do is mentally separate out the problem into the different pieces of trying to shoot something...
In order to hit a target with an aimed device that can move, one must be able to track and move the device to follow the target. The targeter observes the target moving, and moves their aim to follow. If a tracker has a limited amount of movement, then its tracking ability will be hampered and it may have a hard time tracking some things. but if the tracker has a large amount of tracking freedom, it can potentially track many things. Think about the difference between a tank turret and you pointing at something with your finger.
Another factor is how fast the tracker can track. If it is very slow (think "tank turret"), then it can't track a target that moves fast. Instead it has to rely on anticipation of the target's path. On the other hand a tracker with "fast" speed can quickly move to a target's new location.
Tracking Reaction Time
A third factor in tracking is the reaction time of the tracking. That is, when the target changes direction, how fast can the tracker react? The ultimate tracker is one with fast tracking speed and instant reaction time - it can track any change.
How well can the targeter recognize a target? If one is tracking a target in a complex environment, there may be times when the targeter fails to recognize or "loses" the target. The faster the targeter can recognize a target, the better it will do. The less likely it is to lose a target, the better it will do.
Shooting Reaction Time
Just because the target shows up in the crosshair for a brief moment of time doesn't mean that a shot will happen. Can the tracker react fast enough to pull the trigger? Really bad trackers with really bad reaction time won't hit anything. Really good trackers with really good reaction time will hit anything, because they only need the slightest bit of time on target.
Anticipation of movement is another factor. This is the difference between just trying to track to where the target is now, versus tracking to where you think the target will be. If a tracker can anticipate, they can track the target better, and get more chances to have the target in the crosshairs, and thus improve their ability to get a shot off based on their reaction time. Zero anticipation trackers would just automatically move the aim towards the target, irrespective of the target's actions. The worst case is a tracker who's speed is slow with no anticipation trying to track a simple moving target. Imagine a target that just steps to the left and then to the right every few seconds. A slow tracker would just keep bouncing the aim back and forth, never fast enough to get the target. Only if the target stopped moving could the tracker hit it, and only then if the stop was long enough for the reaction time.
Modelling Target Movement
As mentioned up top, the tracker can anticipate the target by modelling its movement, which is not necessarily that hard to do. If a vehicle is driving at some speed, there are a finite number of places that vehicle can be in the next second, and they are laid out essentially like a triangle in front of their movement. The faster they are going, the tighter the triangle is. The faster they can turn, the wider it is. A really fast vehicle that can hardly turn (like a rocket) has a very small narrow potential path. A slow one that can turn very well has a much wider potential path. It's like those backup cameras on some cars that overlay lines showing you where your car will go if you keep driving as it is now, plus where you potentially could go if you were to turn the wheel more.
So with that in mind, you should put your "potential target space" box in that potential path space. If you know your target has a tendency to veer from side to side, your target box needs to be wide enough to encompass all possible movements. If your target is pretty linear in their movement, you can make your target box much smaller and centered on the anticipated location of movement. I think this kind of thinking will help you make a single solution to tracking that doesn't really differentiate between linear and non linear anticipation. Linear tracking is simply anticipation with a higher level of confidence (smaller targeting box), while random tracking is low level confidence tracking (larger tracking box).
Of course this gets challenging if the target is standing still, because it has the potential to move in any direction. But of course if it sits still too long, it's an easy target even for the slowest tracker.
Consider what you would do if you suddenly had shots landing to your left. Would you run at them? NO! You'd run to the right. Or maybe you'd run for cover. But then maybe the targeter specifically shoots at the cover location so then you don't run for it.
Capacity to Learn
Potentially your targeter can learn from experience. Suppose at first they have no idea of the vehicle's potential movement. They don't know how fast it can go, or how fast it can turn. Observing it in action though will teach them what this is. Meaning that the first time they try and track one, they may not do very well. But they learn the movement behavior, and do better on subsequent tries.
A bit of googling after writing this led met to this manual for rifle marksmanship...
Might be some ideas in there about how a real person would/should/could aim and track.