Through software. The Vehicle Control Unit can control the torque going to each motor independently, and can view the current speed of each motor. By looking at longitudinal acceleration vs motor speed, you can see if the wheels are slipping or not.
Alternatively, if you have a 2WD vehicle, you can just compare the motor speeds to the speeds of the undriven wheels to see if the wheels are slipping.
It's surprisingly nontrivial to detect how much the wheels are slipping, but once you can you vary the torque command based on the amount of wheelslip.