This is a problem I've struggled with before. The issue is that most textbooks are not clear enough in their definitions of the fixed and rotating reference frames. I've tried to be as comprehensive as possible in my answer, I hope it helps!
To describe the motion of a rigid body through space we must make use of two separate reference frames:
Firstly, a fixed (i.e. inertial) reference frame with a set of orthonormal basis vectors $\mathbf{e}_i$. These vectors are constant in time to all inertial observers. I will call the inertial reference frame $K$, and this set of vectors $S = \{\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3\}$.
Secondly, the body frame - a non-inertial reference frame which moves with the rigid body. A second set of orthonormal basis vectors $\mathbf{e}'_j$ move with this frame. I will call this frame of reference $K'$, and this set of vectors $S' = \{\mathbf{e}_1', \mathbf{e}_2', \mathbf{e}_3'\}$.
The diagram below illustrates this picture (the weird blob is the rigid body!).
Any vector $
\mathbf{A}$ in $n$-dimensional space can be written as a linear combination of either set of basis vectors: we can write (using $\sum_j \equiv \sum_{j=1}^3$)
$$
\mathbf{A} = \sum_i A_i\mathbf{e}_i = \sum_j A'_j\mathbf{e}'_j.
$$
In particular, if the vector $\mathbf{A}$ is fixed to the rigid body, then the the projection of $\mathbf{A}$ onto each of the $\mathbf{e}_i$ varies with time and thus, the components $A_i$ are functions of time. However, since the projection of $\mathbf{A}$ onto each of the $\mathbf{e}'_j$ is constant with time, the components $A'_j$ are constant with time too. This argument holds if the vector $\mathbf{A}$ is fixed to inertial frame, $K$, or if the vector $\mathbf{A}$ is fixed to the body frame, $K'$.
Importantly, an observer from either reference frame can use either set of basis vectors. The difference is in how they view the behavior of each set of vectors: from the perspective of $K$, the basis vectors $\mathbf{e}_i$ are fixed, but the basis vectors $\mathbf{e}'_j$ are functions of time; however, to an observer in $K'$, i.e. from the perspective of the rigid body, the $\mathbf{e}'_j$ are fixed, and it is instead the vectors $\mathbf{e}_i$ that are time dependent.
Thus, when observed from $K'$,
$$
\left(\frac{\text{d}}{\text{d}t}\right)_{K'}\mathbf{e}'_j = \mathbf{0}.
$$
So the rate of change of a vector $\mathbf{A} = \sum_j A'_j\mathbf{e}'_j$ appears to be
$$
\left(\frac{\text{d}\mathbf{A}}{\text{d}t}\right)_{K'} = \sum_j \dot{A'}_j\mathbf{e}'_j.
$$
However, when written in terms of the orthonormal set $S$, the $\mathbf{e}'_j$ basis vectors are functions of time. I show below that, as observed from $K$,
$$
\left(\frac{\text{d}}{\text{d}t}\right)_{K}\mathbf{e}'_j = \boldsymbol{\omega}\times\mathbf{e}'_j\, \tag{1}
$$
for some time-dependent vector $\boldsymbol{\omega}= \boldsymbol{\omega}(t)$. So,
\begin{align}
\left(\frac{\text{d}\mathbf{A}}{\text{d}t}\right)_{K}
&=
\left(\frac{\text{d}\sum_j {A'}_j\mathbf{e}'_j }{\text{d}t}\right)_{K}
&&\text{by construction}
\\
&=
\sum_j \dot{A'}_j\mathbf{e}'_j +A'_j\dot{\mathbf{e}}'_j
&&\text{product rule}
\\
& = \sum_j \dot{A'}_j\mathbf{e}'_j + A'_j \boldsymbol{\omega}\times\mathbf{e}'_j
&&\text{by Eq.~1}
\\
& =\sum_j \dot{A'}_j\mathbf{e}'_j+ \boldsymbol{\omega}\times(A'_j \mathbf{e}'_j)
&&\text{homogeneity}
\\
& = \sum_j \left(\dot{A'}_j\mathbf{e}'_j\right) +\boldsymbol{\omega}\times\mathbf{A}.
&&\text{linearity}
\end{align}
Thus, we write that
$$
\left(\frac{\text{d}\mathbf{A}}{\text{d}t}\right)_{K'} = \left(\frac{\text{d}\mathbf{A}}{\text{d}t}\right)_{K} - \boldsymbol{\omega}\times\mathbf{A}. \tag{2}
$$
This is the crux of the problem: to an observer in the moving frame, every vector appears to have an additional term in its time derivative, when, in fact, it is the frame itself that is changing.
With this, Euler's equations follow quite naturally. Let $\mathbf{T}$ be the torque on the body, and let $\underline{\mathbf{I}}\boldsymbol{\omega}$ be the angular momentum of the body, where $\underline{\mathbf{I}}$ is the moment of inertia tensor. The key point is that as measured in $K'$, the moment of inertia tensor is constant. (This is not true in $K$, as the distribution of the mass of the body with respect to the $\mathbf{e}_i$ basis changes with time.) Using equation (2), this means that
\begin{align}
\left(\frac{\text{d}}{\text{d}t}\right)_{K'}\underline{\mathbf{I}}\boldsymbol{\omega}
&=
\underline{\mathbf{I}}\left(\frac{\text{d}}{\text{d}t}\right)_{K'}\boldsymbol{\omega}
&&\underline{\mathbf{I}}~\text{constant in}~ K'
\\
&=
\underline{\mathbf{I}}\left[\left(\frac{\text{d}}{\text{d}t}\right)_{K}\boldsymbol{\omega}-\underbrace{\boldsymbol{\omega}\times\boldsymbol{\omega}}_{\mathbf{0}}\right]
&&\text{by Eq.~2}
\\
&=
\underline{\mathbf{I}}\left(\frac{\text{d}}{\text{d}t}\right)_{K}\boldsymbol{\omega}.&&
\tag{$\star$}
\end{align}
Finally, the rate of change of angular momentum in the body is equal to the applied torque:
\begin{align}
\mathbf{T}
&= \left(\frac{\text{d}\underline{\mathbf{I}}\boldsymbol{\omega} }{\text{d}t}\right)_{K}
\\
&=
\left(\frac{\text{d}\underline{\mathbf{I}}\boldsymbol{\omega}}{\text{d}t}\right)_{K'}+\boldsymbol{\omega}\times(\underline{\mathbf{I}}\boldsymbol{\omega})
&&\text{by Eq.~2}
\\
&=
\underline{\mathbf{I}}\left(\frac{\text{d}\boldsymbol{\omega} }{\text{d}t}\right)_{K}+\boldsymbol{\omega}\times(\underline{\mathbf{I}}\boldsymbol{\omega}).
&&\underline{\mathbf{I}}~\text{constant in} ~K'
\end{align}
This is Euler's equation! It holds from the perspective of the inertial frame, but is derived using the basis vectors of the non-inertial frame.
All that remains is to prove Equation (1). To do so, it is best to forget about the body frame $K'$, and to think of the $\mathbf{e}'_j$ as simply a set of vectors which move with respect to the $\mathbf{e}_i$, as seen from $K$. The moving basis vectors $\mathbf{e}'_j(t)$ are related to the fixed basis vectors $\mathbf{e}_i$ by a time dependent rigid rotation, which can be described by a matrix $\underline{\mathbf{R}}(t)$. Using Einstein notation, we have
$$
\mathbf{e}'_j(t) = R_{ji}(t) \mathbf{e}_i, \qquad\text{and}\qquad \mathbf{e}_i = R_{ji}^\top(t) \mathbf{e}'_j(t). \tag{3}
$$
Since $\underline{\mathbf{R}}$ is a rotation matrix, it is orthogonal. So, for all times $t$ it satisfies
$$
\underline{\mathbf{R}}(t)\underline{\mathbf{R}}^\top(t) = \underline{\mathbf{I}},
$$
where $\underline{\mathbf{I}}$ is the identity matrix. Differentiating this with respect to time we find
\begin{align}
\underline{\dot{\mathbf{R}}}(t)\underline{\mathbf{R}}^\top(t)+\underline{\mathbf{R}}(t)\underline{\dot{\mathbf{R}}}^\top(t)
&= \underline{\mathbf{0}}
\\
\underline{\dot{\mathbf{R}}}(t)\underline{\mathbf{R}}^\top(t) + \left(\underline{\dot{\mathbf{R}}}(t)\underline{\mathbf{R}}^\top(t)\right)^T &= \underline{\mathbf{0}}.
\end{align}
So, the matrix $\underline{\dot{\mathbf{R}}}(t)\underline{\mathbf{R}}^\top(t)$ must be antisymmetric. This implies that there exists some vector $\boldsymbol{\omega} = (\omega_1, \omega_2, \omega_3)$ such that
$$
\underline{\dot{\mathbf{R}}}(t)\underline{\mathbf{R}}^\top(t) = [\boldsymbol{\omega}\times]\,.
$$
Here, the cross-product matrix
$$
[\boldsymbol{\omega}\times] = \begin{pmatrix}0 & -\omega_3 & \omega_2 \\ \omega_3 & 0 & -\omega_1 \\ -\omega_2 & \omega_1 &0 \end{pmatrix}
$$
acts on vectors like a cross product as $[\boldsymbol{\omega}\times]\mathbf{A} = \boldsymbol{\omega}\times\mathbf{A}$. If you have not seen this before look here 2. For our purposes, it will be most useful to know the components of this matrix in the moving basis $\mathbf{e}'_j$. Using $\boldsymbol{\omega} = \omega'_j\mathbf{e}'_j$, we have
$$
\left(\underline{\dot{\mathbf{R}}}(t)\underline{\mathbf{R}}^\top(t)\right)'_{ij} = \mathbf{e}'^T_i\left(\underline{\dot{\mathbf{R}}}(t)\underline{\mathbf{R}}^T(t)\right)\mathbf{e}'_j = \epsilon_{ijk}\,\omega'_k.
$$
With this, we can calculate the time derivatives of the primed basis vectors:
\begin{align}
\dot{\mathbf{e}}'_j(t) &= \dot{R}_{ji}(t)\, \mathbf{e}_j
&&\text{by Eq. 3}
\\
&= \dot{R}_{ji} \sum_{k=1}^n R^\top_{kj}\,\mathbf{e}'_k
&&\text{by Eq. 3}
\\
&= \epsilon_{ikm}\,\omega'_m \mathbf{e}'_k
\\
&= \epsilon_{ikm}(\boldsymbol{\omega}\cdot\mathbf{e}'_m)\mathbf{e}'_k\\
&= \frac{1}{2} \epsilon_{ikm}(\boldsymbol{\omega}\cdot\mathbf{e}'_m)\mathbf{e}'_k - \frac{1}{2}\epsilon_{ikm}(\boldsymbol{\omega}\cdot\mathbf{e}'_k)\mathbf{e}'_m\\
&=\frac{1}{2}\epsilon_{ikm}\boldsymbol{\omega}\times(\mathbf{e}'_k\times\mathbf{e}'_m)\\
&=\frac{1}{2}\epsilon_{ikm}\boldsymbol{\omega}\times(\epsilon_{kml}\mathbf{e}'_l)\\
&=\delta_il\boldsymbol{\omega}\times\mathbf{e}'_l\\
&=\boldsymbol{\omega}\times\mathbf{e}'_i(t).\tag{2}
\end{align}
Thus, as seen from the inertial frame, there exists an instantaneous angular velocity vector $\boldsymbol{\omega}$ around which the primed basis vectors $\mathbf{e}'_i(t)$ rotate.
Finally, here is an alternative derivation of Euler's equation that I am particularly fond of. We proceed by directly by differentiating the moment of inertia tensor. To do this, we align the $\mathbf{e}'_i$ with the principal axes of the body. We denote the principal moment of the body along the $\mathbf{e}'_i$ axis as $I_i$. Since the body is rigid, the pricipal moments are constants, and so we can explicitly write the moment of inertial tensor as
$$
\underline{\mathbf{I}} = \sum_i I_i \mathbf{e}'_i \otimes \mathbf{e}'_i
$$
(summation convention not used here).
The time derivative of $\underline{\mathbf{I}}$ (in $K$) is then
$$
\left(\frac{\text{d}}{\text{d}t}\right)_{K} \underline{\mathbf{I}} = \sum_i I_i\left[\dot{\mathbf{e}}'_i\otimes\mathbf{e}'_i+\mathbf{e}'_i\otimes\dot{\mathbf{e}}'_i\right] = \sum_i I_i\left[(\boldsymbol{\omega}\times\mathbf{e}'_i)\otimes\mathbf{e}'_i+\mathbf{e}'_i\otimes(\boldsymbol{\omega}\times\mathbf{e}'_i)\right].
$$
Now, let $\mathbf{b}$ and $\mathbf{c}$ be arbitrary vectors, and $\underline{\mathbf{A}}$ be a linear operator. Using the definition of the tensor product, we have
$$
\left[(\underline{\mathbf{A}}\mathbf{b})\otimes\mathbf{c}\right]_{ij}=\left(\underline{\mathbf{A}}\mathbf{b}\right)_i c_j = A_{ik}b_k c_j = \left(\underline{\mathbf{A}}\right)_{ik}\left(\mathbf{b}\otimes\mathbf{c}\right)_{kj} = \left[\underline{\mathbf{A}}(\mathbf{b}\otimes\mathbf{c})\right]_{ij}
$$
and
$$
\left[\mathbf{b}\otimes(\underline{\mathbf{A}}\mathbf{c})\right]_{ij}=b_i\left(\underline{\mathbf{A}}\mathbf{c}\right)_j = b_i A_{jk} c_k = \left(\mathbf{b}\otimes\mathbf{c}\right)_{ik}\left(\underline{\mathbf{A}}^T\right)_{kj} = \left[(\mathbf{b}\otimes\mathbf{c})\underline{\mathbf{A}}^T\right]_{ij}.
$$
Therefore,
\begin{align}
\left(\frac{\text{d}}{\text{d}t}\right)_{K} \underline{\mathbf{I}}&= \sum_i I_i\left[(\boldsymbol{\omega}\times\mathbf{e}'_i)\otimes\mathbf{e}'_i+\mathbf{e}'_i\otimes(\boldsymbol{\omega}\times\mathbf{e}'_i)\right] \\
&= \sum_i I_i\left[[\boldsymbol{\omega}\times](\mathbf{e}'_i\otimes\mathbf{e}'_i)+(\mathbf{e}'_i\otimes\mathbf{e}'_i)[\boldsymbol{\omega}\times]^T\right]\\
&=[\boldsymbol{\omega}\times]\underline{\mathbf{I}}-\underline{\mathbf{I}}[\boldsymbol{\omega}\times]
\end{align}
where $[\boldsymbol{\omega}\times]$ is the operator defined in the previous section, and in the last line I have used that this operator is anti-symmetric.
Thus, the time derivative of the angular momentum is
\begin{align}
\mathbf{T} &= \left(\frac{\text{d}}{\text{d}t}\right)_{K} (\underline{\mathbf{I}}\boldsymbol{\omega}) \\
&= \underline{\mathbf{I}}\left(\frac{\text{d}}{\text{d}t}\right)_{K} \boldsymbol{\omega}+\boldsymbol{\omega}\left(\frac{\text{d}}{\text{d}t}\right)_{K} \underline{\mathbf{I}}\\
&=\underline{\mathbf{I}}\left(\frac{\text{d}}{\text{d}t}\right)_{K} \boldsymbol{\omega} + [\boldsymbol{\omega}\times]\underline{\mathbf{I}}\boldsymbol{\omega}-\underline{\mathbf{I}}\underbrace{[\boldsymbol{\omega}\times]\boldsymbol{\omega}}_{\boldsymbol{\omega}\times\boldsymbol{\omega}=\mathbf{0}}\\
&=\underline{\mathbf{I}}\left(\frac{\text{d}}{\text{d}t}\right)_{K} \boldsymbol{\omega} + \boldsymbol{\omega}\times(\underline{\mathbf{I}}\boldsymbol{\omega})
\end{align}
as before.