The answer by lab bhattacharjee is perfectly right, but it requires to rotate your hyperbola's loci the indeterminate angle $\Phi$ so that in your new coordinates the principal axes coincide with the coordinate axes. For that you must apply an arbitrary rotation and solve $\Phi$ a posteriori so that the new loci's equations simplify to the desired form. Since the question emphasizes that the "expression appears before rotating coordinates", let us try to get the angle of the principal axis for an arbitrary hyperbola with center at the origin (which is the assumption at that step in the linked wikipedia article).
To do this, notice that the centered hyperbola, possibly not aligned yet, i.e. with foci on an arbitrary line passing through the origin, has equation in coordinates $(\xi,\eta)$ (cf. aforementioned link for notation conventions): $A_{xx}\xi^2+2A_{xy}\xi\eta + A_{yy}\eta^2+\frac{\Delta}{D}=0$ Now, its asymptotes are lines through the origin on these coordinates. The trick here is to notice that the principal axis of the hyperbola is always the bisector line in between the two asymptotes, i.e., the principal axis forms an angle with the $\xi$-axis such that its angles with the asymptotes are equal (equivalently, the principal axis divides in two the angle between the asymptototes). This is true even if the hyperbola is not rectangular, because a hyperbola is symmetric with respect to its principal axes. Therefore, if the asymptotes form angles $\alpha_{+}, \alpha_{-}$ with the $\xi$-axis, then $\Phi=\frac{\alpha_{+}+\alpha_{-}}{2}\Rightarrow 2\Phi=\alpha_{+}+\alpha_{-}\Rightarrow \tan (2\Phi)=\frac{\tan\alpha_{+}+\tan\alpha_{-}}{1-\tan\alpha_{+}\tan\alpha_{-}}$ We only need then the slopes of the asymptotes $\alpha_{\pm}$, for which we must use another trick: notice that any line passing through the origin with varying slope, $\tan\alpha=\eta/\xi$, must coincide with each of the asymptotes for the slopes we are looking for. By definition of asymptote, our hyperbola behaves as those lines at infinity, so we can get the slopes $\tan\alpha_{\pm}$ by solving $\eta/\xi$ in the locus equation when $\xi\rightarrow\infty$: $\lim_{\xi\rightarrow\infty}\left[ A_{xx}+2A_{xy}\left(\frac{\eta}{\xi}\right) + A_{yy}\left(\frac{\eta}{\xi}\right)^2+\frac{\Delta}{D\cdot\xi^2}\right]=0$ $A_{xx}+2A_{xy}\tan\alpha_{\pm} + A_{yy}(\tan\alpha_{\pm})^2=0$ $\tan\alpha_{\pm}=\frac{-A_{xy}}{A_{xx}}\pm\frac{\sqrt{A^2_{xy}-A_{yy}A_{xx}}}{A_{xx}}$ which substituting in the expression for $\tan (2\Phi)$ and simplifying, yields: $\tan (\Phi)=\frac{-2A_{xy}/A_{xx}}{1-\left[ \left(\frac{-A_{xy}}{A_{xx}}\right)^2- (A^2_{xy}-A_{yy}A_{xx})\right]}=\frac{2A_{xy}}{A_{xx}-A_{yy}}.$