This problem can be concluded as **colorbox inside align**, so we can use
```tex
\documentclass{article}
\usepackage{xcolor}
\usepackage{mathtools}
% Reference: https://tex.stackexchange.com/a/13693/234654
\newlength\dlf
\newcommand\alignedbox[2]{
% #1 = before alignment
% #2 = after alignment
&
\begingroup
\settowidth\dlf{$\displaystyle #1$}
\addtolength\dlf{\fboxsep+\fboxrule}
\hspace{-\dlf}
\fcolorbox{yellow}{yellow}{$\displaystyle #1 #2$}
\endgroup
}
\begin{document}
\begin{align*}
%--
i^7 &= 1 \times i^3 \\[5mm]
%--
i^7 &= i^3 \\[5mm]
%--
i^7 &= i^2 \times i \\[5mm]
%--
i^7 &= -1 \times i \\[5mm]
%--
i^7 &= -i \\[5mm]
%--
\alignedbox{i^7}{=-i}
\end{align*}
\end{document}
```
This genius idea is borrowed from [here](https://tex.stackexchange.com/a/13693/234654).
This method calculates the length before the aligned mark `&` into variable `\dlf`. Then `\hspace` is used to left shift the colorbox. Now the alignment is achieved.
[![RESULT][1]][1]
[1]: https://i.sstatic.net/c11YL.png