If I understand the notation correctly, your birth-and-death process $Z_{t}$ increments as follows: given $Z_{t}$,
\begin{align*}
Z_{t+h} =
\begin{cases}
Z_{t}-2 & \text{with probability } d_{2}Z_{t}h+o(h) \\
Z_{t}-1 & \text{with probability } d_{1}Z_{t}h+o(h) \\
Z_{t} & \text{with probability } 1-(b_{1}+b_{2}+d_{1}+d_{2})Z_{t}h+o(h) \\
Z_{t}+1 & \text{with probability } b_{1}Z_{t}h+o(h) \\
Z_{t}+2 & \text{with probability } b_{2}Z_{t}h+o(h).
\end{cases}
\end{align*}
For simplicity of notation, let me assume that $d_{2}=b_{2}=0$. Write the generating function of $Z_{t}$ as $u(s,t) = \mathbb{E}(s^{Z_{t}})$.
By the tower property, we can write
\begin{align*}
u(s,t+h) := \mathbb{E}(s^{Z_{t+h}}) = \mathbb{E}(\mathbb{E}(s^{Z_{t+h}}|Z_{t})).
\end{align*}
Then, using the formulation of $Z_{t}$ above,
\begin{align*}
\mathbb{E}(s^{Z_{t+h}}|Z_{t}) & = s^{Z_{t}+1}b_{1}Z_{t}h+s^{Z_{t}-1}d_{1}Z_{t}h+s^{Z_{t}}(1-(b_{1}+d_{1})Z_{t}h)+o(h) \\
& = s^{Z_{t}+1}b_{1}Z_{t}h+s^{Z_{t}-1}d_{1}Z_{t}h+s^{Z_{t}}-s^{Z_{t}}(b_{1}+d_{1})Z_{t}h+o(h).
\end{align*}
Taking the expectation of both sides, and using the fact that $u_{s} := \frac{\partial u}{\partial s} = \mathbb{E}(Z_{t}s^{Z_{t}-1})$,
\begin{align*}
u(s,t+h) = s^{2}b_{1}u_{s}(s,t)h+d_{1}u_{s}(s,t)h+u(s,t)-s(b_{1}+d_{1})u_{s}(s,t)+o(h).
\end{align*}
Rearranging,
\begin{align*}
\frac{u(s,t+h)-u(s,t)}{h} = u_{s}(s,t)(b_{1}s^{2}+d_{1}-s(b_{1}+d_{1}))+o(1).
\end{align*}
Taking $h \to 0$, we arrive at the PDE:
\begin{align*}
u_{t}(s,t) = u_{s}(s,t)(b_{1}s^{2}+d_{1}-s(b_{1}+d_{1})).
\end{align*}
The boundary conditions come from $Z_{0}=1$. The case of multiple births and deaths is similar, as is the derivation of the PDE for the MGF.