Using the spy library, I would like to first highlight (in this case with an rectangle) the area which gets magnified and the show the magnification on the next slide. I am doing this manually in the MWE below, but prefer an automatic solution.
\documentclass[10pt,aspectratio=169]{beamer}
\usepackage{tikz}
\usetikzlibrary{spy}
\begin{document}
\begin{frame}
\begin{tikzpicture}[%
spy using outlines={rectangle, magnification=4, size=2cm, connect spies},
]
\fill [blue!20] (0,0) rectangle (2,3);
% I want to avoid to manually draw this rectangle:
\draw (-2.5mm,-2.5mm) rectangle (2.5mm, 2.5mm);
\pause
\spy on (0,0) in node at (-2,1);
\end{tikzpicture}
\end{frame}
\end{document}