Constructing cotorsion pairs over generalized path algebras