How is the group $O(p,q)$ defined wrt quadratic forms? 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 &amp; 1 \\
  1 &amp; -1 \\
\end{pmatrix} \quad \quad \text{and} \quad \quad B = \begin{pmatrix}
  1 &amp; 1 \\
  1 &amp; -2 \\
\end{pmatrix}
$$
are going to be different - in this case
$\begin{pmatrix}
  1 &amp; 2 \\
  2 &amp; 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})$.
$O(p,q)$ depends of the choice of the signature of the quadratic form $Q(x)=\sum_{i=1}^{i=p}x_i^2-\sum_{i=p+1}^{i=n}x_i^2$ with $p+q=n$. Here the signature is $(p,q)$. You can always find a basis where the quadratic form has that expression. Two quadratic forms with the same signature yields to the same automorphisms group.