The idea is this. You will start from an action in the form
$$S_I=\int d^4x j_\mu A^\mu$$
and for a system of charge you will write down
$$j_\mu=(\rho(x),\rho(x)\dot{\bf x}).$$
An integration by part in time will do the job producing the contribution
$$S'_I=-\int d^4x \rho(x){\bf x}\cdot {\bf E}$$
using the standard relation ${\bf E}=-\partial{\bf A}/\partial t-\nabla\phi$ and using is made of the continuity equation. You can see classically that the contribution is the standard dipolar interaction. With a set of pointlike charges, $\rho(x)=\sum_aq_a\delta^3(x-x_a)$, you can integrate in the volume and you will be left with the interaction term
$$V=-\sum_aq_a{\bf x}_a\cdot{\bf E(x_a,t)}.$$
This translate as is into quantum mechanics and finally
$${\hat\mu}_{mn}=\sum_aq_a\langle\psi_m|{\bf x}_a|\psi_n\rangle.$$
In this case we are assuming that the e.m. field is an external field.