How was this PDE solution guessed?

There are clues in the form of the equation, though a finance intuition might be a better guide. Taking $a$, $b$, and $\sigma$ all zero suggests solutions like $e^{rt}$. Putting those terms back then you see that the plain $t$ won't do, so perhaps $e^{r c(t)}$ will be a possible place to begin looking. The other clue is the common practice of looking for product solutions like $g(r)h(t)$, or maybe in this case $e^{r c(t)} h(t)$, which seems to have worked.

It is important to realize that finding a formula that works does not prove that you have found THE solution. You have to make a uniqueness argument to assert that.