Consider the position and momentum operators $\hat q$ and $\hat p$, defined respectively in terms of creation and destruction operators in the usual way: $$ \hat q = c (\hat a + \hat a^\dagger), \qquad \hat p = \frac{i\hbar}{2c} ( \hat a^\dagger - \hat a), \tag 1 $$ for some constant $c$, where $\hat a$ and $\hat a^\dagger$ satisfy the canonical commutation relations: $$ [\hat a, \hat a^\dagger] = 1, \qquad [\hat a,\hat a] = [\hat a^\dagger, \hat a^\dagger] = 0. \tag 2$$ If follows immediately that, as expected, $[\hat q, \hat p] = i \hbar$.
My question is now: starting from these definitions of $\hat p$ and $\hat q$, how can I derive the common relation $\hat p = -i \hbar \frac{\partial}{\partial q}$, or some equivalent version of this relation? In other words, how can I compute the value of $\langle q | \hat p| \psi \rangle$, or equivalently of $\langle q| \hat p | q' \rangle$?
If I try to simply compute this using the definition of $\hat p$ given in (1) I get nonsensical results, I'm gessing because of $|q \rangle$ being not normalized eigenstates. What method should then be used in this context?