I am not sure whether there is any direct feature for the same. Experts will comment on the same
If it is not there - other option would be to call an API for deallocating the license automatically and schedule the process at regular intervals checking their last login time