Let the generalized eigenpair $\lambda, \mathbf x$ for matrices $A, B$ be defined as $$ A \mathbf x = \lambda B \mathbf x, $$ with $A = A^\mathsf{H}, B = B^\mathsf{H}$.
If $A$ or $B$ is positive definite then $\lambda \in \mathbb R$. Indeed: 1. $A > 0$. Using Cholesky decomposition $A = LL^\top$ $$ LL^\top \mathbf x = \lambda B \mathbf x\\ \mathbf w = L^\top \mathbf x\\ \mathbf w = \lambda L^{-1} B L^{-\top} \mathbf w $$ thus $\lambda^{-1}$ is an eigenvalue of a Hermitian matrix $L^{-1} B L^{-\mathsf{H}}$. Same for the case of $B > 0$. This still holds for negative definite matrices, one can simply invert the matrix sign.
But a simple example of two indefinite matrices $A = \left(\begin{smallmatrix}1 & 0 \\ 0 & -1\end{smallmatrix}\right), B = \left(\begin{smallmatrix}0 & 1 \\ 1 & 0\end{smallmatrix}\right)$ shows that the eigenvalues $\lambda$ can be complex-valued, for this case $\lambda = \pm i$.
I'm looking for some necessary or sufficient conditions for $\lambda$ to be real in case when neither of the matrices $A, B$ are definite. The one condition I've found is $AB = BA$, it is known that for matrices that commute the eigenvectors are the same, thus generalized eigenvalues are simply quotients of $\lambda(A)$ and $\lambda(B)$, thus real.