What OP cited is the derivation of the Boltzmann distribution starting from the micro-canonical ensemble, characterized by a fixed energy and a fixed number of constituent particles. In mathematical terms, the problem statement is as follows:
Maximize the function $\ln W(\{n_i\})$ under the constraints $\sum_i n_i \epsilon_i = E$ and $\sum_i n_i = N$.
The solution is a function of $E$ and $N$, so let's define
$\ln \Omega(E, N)$ := (constrained maximum of $\ln W$ as a function of $E$ and $N$),
$\tilde{n}_i (E, N)$ := (value of $n_i$ at the constrained maximum).
Notice that $\ln\Omega = \ln W(\{\tilde{n}_i\})$. Also, this quantity is what appears in Boltzmann's entropy formula $S=k\ln\Omega$ because $\Omega$ is the number of available states for given values of $E$ and $N$. This observation enables us to relate $\ln\Omega$ to the thermodynamic temperature:
\begin{equation}
\frac{\partial \ln \Omega}{\partial E} = \frac{1}{k}\frac{\partial S}{\partial E} = \frac{1}{kT}.
\end{equation}
Now, OP's question can be rephrased as follows:
When deriving the Boltzmann distribution starting from the micro-canonical ensemble, $\beta$ is introduced as a Lagrange multiplier associated with the constraint $\sum_i n_i \epsilon_i = E$. How can we relate $\beta$ to the thermodynamic temperature, i.e., establish that $\beta = \frac{\partial \ln \Omega}{\partial E}$?
The underlying principle is really the chain rule in multivariate calculus:
\begin{equation}
\begin{split}
\frac{\partial \ln \Omega}{\partial E} &= \sum_i \frac{\partial \ln W}{\partial n_i}\bigg|_{n_i = \tilde{n}_i} \frac{\partial \tilde{n}_i}{\partial E}\\
&= \sum_i (\alpha + \beta\epsilon_i)\frac{\partial \tilde{n}_i}{\partial E}\\
&= \alpha\frac{\partial}{\partial E}\Big(\sum_i \tilde{n}_{i}\Big) + \beta\frac{\partial}{\partial E}\Big(\sum_i \tilde{n}_{i}\epsilon_i\Big)\\
&= \alpha \frac{\partial N}{\partial E} + \beta \frac{\partial E}{\partial E}\\
&= \beta.
\end{split}
\end{equation}