Locally graded groups with a nilpotency condition on infinite subsets