On the generalization of the Lambert $W$ function