A generalization of the Butler-McGehee lemma and its applications in persistence theory