The ammonium nitrate dissociate in water:
$$\ce{NH4NO3 -> NH4+ + NO3-}$$
The $\ce{NH4+}$ and $\ce{NH3}$ form together the ammonia $\mathrm{pH}$ buffer with $\ce{NH4+}$ acidity constant $\mathrm{p}K_\mathrm{a}=9.25$:
$$\mathrm{pH}=\mathrm{p}K_\mathrm{a}+ \log { \frac {c_{\ce{NH3}}}{c_{\ce{NH4+}}}}$$
The titration curve as $\mathrm{pH}=f(V)$ is the most flat at $\mathrm{pH}=\mathrm{p}K_\mathrm{a}=9.25$, where the buffer has the biggest capacity.
For a given solution, containing $\ce{NH4+}$ and $\ce{NH3}$, titration with $\ce{HCl}$ or $\ce{NaOH}$ causes respective acid-base reactions:
$$\begin{align}
\ce{NH3 + H+ &-> NH4+ \\
NH4+ + OH- &-> NH3 + H2O} \\
\end{align}$$
The ammonia buffer causes $\mathrm{pH}$ being quite stable during titration, until one of the 2 ammonia forms is practically spent.
At that point, the $\mathrm{pH}$ titration curve gets very progressively bent up or down, respectively and the titrator stops the titration.
The content of $\ce{NH4NO3}$ and $\ce{NH3}$ is then obtained by obvious routine calculation.
$$\begin{align}
m_{\ce{NH3}}&= M_{\ce{NH3}}\cdot c_{\ce{HCl}}\cdot V_{\ce{HCl}}\\
m_{\ce{NH4NO3}}&= M_{\ce{NH4NO3}}\cdot c_{\ce{NaOH}}\cdot V_{\ce{NaOH}}\\
\end{align}$$
Note that at $\mathrm{pH}=13$, $\ce{NH4+}$ ions practically do not exist, as $ \frac {c_{\ce{NH3}}}{c_{\ce{NH4+}}}=5620$
If we consider $\mathrm{pH}$ of ammonia solution itself, it is
$$\begin{align}
\mathrm{pH}=14 - 0.5 \cdot ( \mathrm{p}K_\mathrm{b}-\log c) \\
13=14 - 0.5 \cdot ( 4.75 -\log c) \\
\end{align}$$
$c_{\ce{NH3}}$ would be 563 mol/L, what is nonsense. Such $\mathrm{pH}$ is not achievable by ammonia alone, but a mineral hydroxide would be present.
If there was initially any ammonium nitrate, it would be converted to ammonia:
$$\ce{NH4NO3 + NaOH -> NaNO3 + NH3 + H2O}$$
In such a case, determination of both compounds by titration is not possible, as there are no ammonium ions and ammonia would be titrated together with hydroxide.