On locally graded groups with a word whose values are Engel