Classifying space for fibrations with Eilenberg-MacLane space fibers and nontrivial fundamental group actions

Mark Grant's excellent answer already resolves the question. However, let me sketch how this arises as a special case of the more general problem of classifying fibrations with a given fiber.

For any space $X$, the homotopy automorphisms $\operatorname{hAut}(X)$ are defined as the self-homotopy equivalences of $X$ (topologized with the compact-open topology; note that they form a union of path components of the space of all self-maps of $X$). They form a group-like monoid, so there is a connected pointed space $B\operatorname{hAut}(X)$ such that there is an equivalence of $A_\infty$-spaces $\operatorname{hAut}(X)\simeq \Omega B\operatorname{hAut}(X)$. In fact, $B\operatorname{hAut}(X)$ can be built as the geometric realization of the simplicial space $B(*,\operatorname{hAut}(X),*) = * \leftarrow \operatorname{hAut}(X) \Leftarrow \operatorname{hAut}(X)\times\operatorname{hAut}(X) \Lleftarrow \dots$. Since $\operatorname{hAut}(X)$ acts on $X$ from the left, we can also build the simplicial space $B(*,\operatorname{hAut}(X),X) = X\leftarrow \operatorname{hAut}(X)\times X\Leftarrow\dots$, and the map $X\to *$ induces a fibration $X\to E_X\to B\operatorname{hAut}(X)$. This is the universal fibration with fiber $X$, that is, for every fibration $X\to F\to Y$ there is a unique homotopy class of maps $f: Y\to B\operatorname{hAut}(X)$ such that $F\simeq f^*E_X$.

If $X = K(A,n)$ is an Eilenberg-MacLane space, the grouplike monoid $\operatorname{hAut}(X)$ can be described quite explicitly: In this case, $X$ can also be given the structure of a grouplike monoid with identity $e$, so that the map $\operatorname{hAut}(X)\to X, f\mapsto f(e)$ has a homotopy right inverse given by sending $x$ to (left, say) translation by $x$. Thus there is a homotopy equivalence $\operatorname{hAut}(X)\simeq \operatorname{hAut}_*(X)\times X$, where $\operatorname{hAut}_*(X)$ is the submonoid of self homotopy equivalences that preserve the basepoint (note, however, that this is not compatible with the monoid structure). Now it is straightforward to show that $\operatorname{hAut}_*(K(A,n))\simeq K(\operatorname{Aut}(A),0)$ is homotopy equivalent to a discrete space, and there is a retraction $\operatorname{hAut}(X) \to \pi_0(\operatorname{hAut}(X))\cong \operatorname{Aut}(A)$. All in all, we obtain an equivalence of grouplike monoids $$ \operatorname{hAut}(K(A,n))\simeq \operatorname{Aut}(A)\ltimes K(A,n) $$ It follows that $B\operatorname{hAut}(K(A,n))$ has exactly two nonvanishing homotopy groups, namely $\pi_1(\operatorname{hAut}(K(A,n)))\cong \operatorname{Aut}(A)$ and $\pi_{n+1}(\operatorname{hAut}(K(A,n)))\cong A$, with the evident action of $\pi_1$ on $\pi_{n+1}$. In particular, a map $f:Y\to B\operatorname{hAut}(K(A,n))$ is determined by $\rho\in H^1(Y;\operatorname{Aut}(A))$, which determines a local system $A_\rho$ on $Y$, and a cohomology class $[f]\in H^{n+1}(Y;A_\rho)$.


Denote $\pi=\pi_1(X)$ and fix the monodromy action $\rho:\pi\to \operatorname{Aut}(A)$. There is a generalized Eilenberg-Mac Lane space $L_\rho(A,n+1)$, whose only non-trivial homotopy groups are $\pi_1(L_\rho(A,n+1))=\pi$ and $\pi_{n+1}(L_\rho(A,n+1))=A$ and such that the action of $\pi_1$ on $\pi_{n+1}$ is given by $\rho$. The construction appears in Section 7 of

Gitler, Samuel, Cohomology operations with local coefficients, Am. J. Math. 85, 156-188 (1963). ZBL0131.38006.

Essentially, $L_\rho(A,n+1)$ is the Borel construction $E\pi\times_\rho K(A,n+1)$ done with simplicial sets, so that everything is sufficiently natural (and the action of $\pi$ on $A$ gives an action of $\pi$ on $K(A,n)$ for all $n$). The path loop fibration is equivariant, giving a fibration sequence $$ K(A,n)\to E\pi\times_\rho PK(A,n+1) \to E\pi\times_\rho K(A,n+1)=L_\rho(A,n+1). $$ I would bet that fibrations over $X$ with fibre $K(A,n)$ and monodromy $\rho$ are classified by maps (Edit: from $X$) into $L_\rho(A,n+1)$ (Edit: inducing the identity on $\pi_1$) using this construction.