Inductor for heat treatment in shafts and pins