This answer corroborates YCor's claim according to which the conditions $n_i \le 1$ for $i > 1$ and $n_1 \le 2$ on the irreducible modular representations'multiplicities $n_i$, are necessary and sufficient for $G$ to be two-generated. We actually show a slightly more general result expressed in terms of the geometric multiplicity of the eigenvalue $1$.
Let $K = Z/pZ, V = K^n$ and $C = Z/qZ$ with $p$ a prime number and with $q \ge 2$ an integer. We fix a group homomorphism $\varphi: C \rightarrow GL(V)$ and a favored generator $a$ of $C$. Let $G = V \rtimes_{\varphi} C$ the corresponding semi-direct product.
The $K$-vector space $V$ is endowed with the structure of $K[X]$-module induced by $X \cdot v = \varphi(a)(v)$. If $V$ is a cyclic $K[X]$-module generated by $w$, then $G$ is generated by $(w, a)$, hence two-generated. The converse holds if $G$ is centerless.
Claim 1. Assume that the center of $G$ intersects $V$ trivially, i.e., $\varphi(a)$ has no non-zero fixed vector. If $G$ is two-generated then $V$ is a cyclic $K[X]$-module.
Proof. Since $\varphi(a)$ has no non-zero eigenvector associated to $1$, the minimal polynomial $\mu(X)$ of $\varphi(a)$ over $K$ is coprime with $X - 1$. As $\mu(X)$ divides $X^q - 1$, this minimal polynomial divides $\nu(X) = 1 + X + \cdots + X^{q -1}$. Let $(v_1a^{n_1}, v_2a^{n_2})$ be a generating pair of $G$ with $v_i \in V, n_i \in \mathbb{Z}$ for $i = 1,2$. We can reduce this pair to a generating pair of the form $(v, wa)$ with $v,w \in V$ by means of Nielsen transformations (consider the induced transformations on $C^2$). Given $u \in V$, we shall show that $u \in K[X] \cdot v$. Since $(v, wa)$ generates $G$, there is a word $x$ on the alphabet $\{x_1^{\pm 1}, x_2^{\pm 1}\}$ such that $u = x(v, wa)$. Write $x = yx_2^{s}$ where $y$ belongs to the normal closure of $x_1$ in the free group $F(x_1, x_2)$ and $s$ lies in $\mathbb{Z}$. Note that we have $y(v, wa) \in K[X]\cdot v$ because $K[X]\cdot v$ is normalized by $wa$. It follows that $s = kq$ for some $k \in \mathbb{Z}$ and hence $u = y(v, wa) + k \nu(X) \cdot w = y(v, wa)$, which completes the proof.
Checking whether $V$ is a cyclic $K[X]$-module can be done algorithmically by computing the Smith Normal Form of $\varphi(a)$ [Theorem 20 of Section 12, 1].
If the center $Z(G)$ of $G$ has a non-trivial intersection with $V$, then $G/(Z(G) \cap V)$ yields a semi-direct product decomposition $V' \rtimes C$ where $V'$ is a finite-dimensional vector space over $K$ of lower dimension. The space $V'$ is obtained as the direct sum of the non-trivial irreducible components of the representation $\varphi$ when $p$ does not divide $q$ as modular representations are completely reducible in this case. If $G$ is moreover two-generated, then $V'$ must be a cyclic $K[X]$-module. In addition, $Z(G)$ must be two-generated.
I am indebted to Derek Holt and Geoff Robinson for the latter remark which is expanded below.
If $G$ is the semi-direct product $V \rtimes C$ of an arbitrary Abelian group $V$ with an arbitrary cyclic group $C$, then it is easily checked that $Z(G) = (Z(G) \cap V) \times (Z(G) \cap C)$. In the context of the question, $C$ is simple so that $Z(G) \cap C$ is either equal to $C$, in which case $G$ is Abelian, or trivial. If moreover $p$ does not divide $q$, it follows that $Z(G)$ is a direct factor of $G$. Thus, if $G$ is two-generared, so is $Z(G)$.
The above claim and the subsequent remark allows us to recover
YCor's claim. Assume that $p$ does not divide $q$. Then the following are equivalent:
- $G$ is two-generated;
- the multiplicity of any non-trivial irreducible representation in $\varphi$ is at most $1$, the multiplicity of the trivial representation is at most $2$.
Proof. In order to show that the condition is sufficient, we can reduce to the case of a cyclic $K[X]$-module by moving out of $V$ one $Z/pZ$-factor of $V$ with trivial $Z/qZ$-action if necessary, noting that $Z/pZ \times Z/qZ \simeq Z/pqZ$. The fact that the condition is necessary follows from Claim 1.
Addendum.
The following generalization relies on the fact that the restriction of $\varphi(a)$ to the generalized eigenspace associated to $1$ has a Jordan normal form.
Claim 2. Let $p$ be a prime number and let $q \ge 2$ be an integer. Let $A = \varphi(a)$ and let $\mu_A$ be the minimal polynomial of $A$ over $K$. Write $\mu_A(X) = (X - 1)^k P(X)$ with $P(X) \in K[X]$ and $P(1) \neq 0$. Let $I \in GL_n(K)$ be the identity matrix and let $E = \ker((A - I)^k)$. Let $\gamma_1(A) = \dim_K(\ker(A - I))$.
We set $$
d(A) = \left\{
\begin{array}{cc} \gamma_1(A) + 1& \text{ if } p \text{ divides } q, \\
\gamma_1(A) & \text{ otherwise. } \end{array}
\right.
$$
Then the group $G = V \rtimes_{\varphi} C$ is two-generated if and only if $V/E$ is a cyclic $K[X]$-module and $d(A) \le 2$.
Proof. The abelianization of $G$ surjects onto an elementary Abelian $p$-group of rank $d(A)$. Thus the condition on $d(A)$ is necessary. By Claim 1, the quotient $G/E$ is two-generated if and only if $V/E$ is a cyclic $K[X]$-module. Now, we only need to verify that $G$ is two-generated when $d(A) = 2$ and $p$ does not divide $q$. Indeed, for the other cases, the restriction of $\varphi(a)$ to $E$ has at most one Jordan block so that $V$ is a cyclic $K[X]$-module if $V/E$ is. If $d(A) = 2$ and $p$ doesn't divide $q$, then the restriction of $\varphi(a)$ to $E$ must be the identity, since otherwise its multiplicative order, which is a divisor of $q$, would be a multiple of $p$ (consider the top left $2$-by-$2$ sub-matrix of a Jordan block). We conclude as before, by moving out of $V$ one of the two point-wise $C$-invariant $Z/pZ$-factors.
[1] D. Dummit and R. Foote, "Abstract Algebra", 1999.