Cumulant expansion of the periodic Anderson model: General derivation