Resolvent operator approach to many‐body perturbation theory. I. Closed shells