To show that the function $\frac{Y_n}{\theta}$ is a pivot we show that its distribution does not depend on $\theta$. Let's find the distribution of the cdf of $\frac{Y_n}{\theta}\in(0,1)$ using the cdf method: let $x\in(0,1)$,
\begin{align}
P\left(\frac{Y_n}{\theta}\leq x\right) &= P\left((\max\{X_1,\ldots,X_n\})\leq x\theta\right)\\
&= P\left(\left(X_1\leq x\theta\right)\cap\ldots\cap\left(X_n\leq x\theta\right)\right)\\
&= \prod\limits_{i=1}^nP\left(X_i\leq x\theta\right)\quad X_i\mbox{ independent}\\
&= \prod\limits_{i=1}^n \frac{x\theta}{\theta}\\
&= \prod\limits_{i=1}^nx\\
&= x^n
\end{align}
Since the cdf doesn't depend on $\theta$, neither will the pdf. Thus the quantity $\frac{Y_n}{\theta}$ is a pivot.