Motors know nothing. The encoders know how much current is being input to the motor, but do not know the rotational output of the motor or the friction coefficient between the tires and the ground. All three are things you'd need to emulate a locking differential in software. You could fake the last two by having a reliable way to measure the travel of the vehicle from a source other than the wheels (GPS, downward camera, etc).