The very same way that you'd do it on the client. If I run an aimbot on an nvidia jetson devkit, using HDMI in to get the screen image and USB emulation to send inputs, your anticheat has to do the same work regardless if it's on the client or the server.
If we complain about companies being too quick closing up their servers when games are not as successful as they hoped... imagine if those servers were x10 or more expensive, due to that kind of analysis for all players. Companies would be much quicker to pull the plug, I guess.
And exactly. You cannot detect that with client-side anti-cheat nonsense either. Record on the HDMI and output a fake USB mouse, why not? Botting doesn't break the physical rules of the game, so you're right that it's hard to detect. One "solution" is to record player movement on the server and detect outliers in behavior and scores. Not perfect (and also very difficult), but just as unreliable as client-side anti cheat nonsense.
Btw tell me exactly how an aimbot that takes the visuals from the player's screen and tilts the player's cursor so (or not so) slightly towards identified moving targets, are to be avoided from the server. Modern cheating is already a hard-ass problem to solve, much more so if no client-level monitoring is desired.