Are undergraduate classes ever used as a means to learning what a PhD candidate needs to learn to earn his PhD? I'm a philosophy major. I sometimes wonder how some professors and PhD candidates know as much as they know about subjects outside of their discipline. For instance, I read one philosophy paper by an author who proficiently used methods from other disciplines {agent-based modelling, computer programming, game theory, advanced set-theory} to argue his claim . 

I know that a big part of earning a PhD is learning how to learn; the author of that paper evidently learned how to do that. When I imagined myself doing the same, I imagined being able to learn the concepts independently, but feeling unsure about how well I had learned them. So I wondered whether completing, or challenging, classes would be a viable strategy for learning about matters relevant, but not pertinent, to my graduate studies. 

Are undergraduate classes ever used as a means to learning what a PhD candidate needs to learn to earn his PhD?
Short answer: sometimes...

Long answer: see below.

(Disclaimer: this describes a STEM-related experience. Not sure how this translates to other disciplines - like philosophy - where instructor interpretation plays a very large role)

I can only relate my personal experience. In grad school I did take a number of classes, but somehow, even though as an undergraduate I was able to juggle 5-6 courses effortlessly, I found it much more difficult to sit through lecture after lecture and do homeworks. 

For certain kinds of material (let's say real analysis, or topology) the discipline of a full length course can be quite useful. But most often what you're looking for is some specific concept or set of concepts from a different area. As you "learn how to learn" better, you quickly realize that the most efficient way to do this is to find some lecture notes, or even find an expert who can explain the key ideas in an hour or so. At that point, if you're experienced enough, you know what to take away, which ideas are important, and which ideas you don't need to understand to get your job done. 

Of course, the other factor is time: you're trying to master a body of work in your own research area, and you don't have a lot of time to spare mastering a whole other area as well. But it's surprising how much you can learn from late night paper binges and frantic googling.

And now of course there are MOOCs and other learning aids that help the self-directed learner. So you can pick up things at your own pace.