Given a symmetric matrix $Q$ defining a quadratic form with signature $(p,q)$, the group of matrices $X$ which preserve $Q$, i.e. $$ Q(Xu, Xv) = Q(u,v), $$ is denoted $O(p,q)$.
So, I understand that, for instance, for a non-degenerate indefinite binary quadratic form $Q$, the group of matrices preserving the form is $O(1,1)$, and this is a group of dimension $1$.
However, I am confused because surely the group of matrices preserving a quadratic form depends on the quadratic form? For instance the matrices preserving $$ A = \begin{pmatrix} 1 & 1 \\ 1 & -1 \\ \end{pmatrix} \quad \quad \text{and} \quad \quad B = \begin{pmatrix} 1 & 1 \\ 1 & -2 \\ \end{pmatrix} $$ are going to be different - in this case $\begin{pmatrix} 1 & 2 \\ 2 & 5 \\ \end{pmatrix}$ preserves $A$ but not $B$.
With this in mind, how is $O(p,q)$ defined? I can find no explanation suggesting $O(p,q)$ depends on the choice of $Q$, but if it is the same group regardless of the choice of $Q$, then what differentiates, say, $O(1,1)$ from $GL_2(\mathbb{N})$?
If $A \in \operatorname{GL}_n(\mathbb{R})$ is a matrix representing a bilinear form, then the group of transformations preserving this form is $\mathscr{O}(A) = \{ X \in \operatorname{GL}_n(\mathbb{R}): X^t A X = A\}$.
Now let $A, B \in \operatorname{GL}_n(\mathbb{R})$ be two matrices representing a quadratic form with signature $(p,q)$ (where $p+q = n$). Then Sylvester's law of inertia tells you that $A = P^tBP$ for some $P \in \operatorname{GL}_n(\mathbb{R})$.
I leave it an exercise for you to show that $\mathscr{O}(A) = P^{-1} \mathscr{O}(B) P$.
That is, the groups $O(p,q)$ you get with different forms are usually not the same, but they will be conjugate in $\operatorname{GL}_n(\mathbb{R})$.