First, we choose a gauge. We will use the Landau gauage, so that
\begin{equation}
\mathbf{A}=B_z x \mathbf{\hat{y}}
\end{equation}
corrseponding to a magnetic field $\mathbf{B}=B_z \mathbf{\hat{z}}$.
With this choice of gauge, the kinetic momentum operators can be rewritten in terms of the canonical momentum operators, as
\begin{equation}
\begin{aligned}
\pi_x &= p_x - \frac{e}{c} A_x = p_x\\
\pi_y &= p_y - \frac{e}{c} A_y = p_y - \frac{e B_z x}{c}
\end{aligned}
\end{equation}
If we write down the Hamiltonian in these terms,
\begin{equation}
\mathcal{H} = \frac{1}{2 m}\left(\mathbf{p}-\frac{e}{c}\mathbf{A}\right)^2
\end{equation}
we see that, since $\mathbf{A}$ has no $y$ dependence, the canonical $p_y$ operator commutes with the Hamiltonian. We may therefore replace it with its eigenvalue, $\hbar k_y$.
Rewriting the momentum operator in terms of the position operator, the creation operator may be written
\begin{equation}
a^\dagger=\frac{l_b}{\sqrt{2} \hbar}(\pi_x+i\pi_y)=\frac{l_b}{\sqrt{2} \hbar}\left( \frac{\hbar}{i}\frac{\partial}{\partial x} + i\hbar k_y - \frac{e}{c}B_z x\right),
\end{equation}
which rewrites this operator in terms of your chosen variables.
Different gauge choices can be made, preserving translational or rotational invariance. This particular gauge choice preserves translation invariance along the $y$-axis. For a more detailed discussion of this topic, see these lecture notes.