Kan extensions, the Yoneda lemma, and (co)monads generated by a functor