You can indeed use the transcendence degree:
Proposition: Let $A$ be a finitely generated $k$-algebra and suppose $A$ is a domain. Suppose $\mathfrak p_0\subsetneqq \mathfrak p_1\subsetneqq \dots \subsetneqq \mathfrak p_r$ is a chain of prime ideals and denote by $d$ the transcendence degree of $K=\mathrm{Frac}(A)$. Then $r\leq d$ with equality if and only if the chain is a maximal one.
Proof: By Noether Normalization, $A$ is module finite over $P=k[t_1,\dots,t_\nu]$ such that $\mathfrak p_i\cap P=\langle t_1,\dots,t_{h_i}\rangle$ for suitable $h_i$. If $L$ is the fraction field of $P$, then $\nu=\mathrm{tr.deg}_k(L)$. But $P\hookrightarrow A$ is an integral extension and module finite, hence $K/L$ is algebraic and therefore $\nu=d$. By the incomparability property of integral extensions we find $h_i<h_{i+1}$ for every $i$, hence $r\leq h_r$. But $h_r\leq \nu=d$, hence $r\leq d$. If $r=d$, then $r$ is maximal as we just showed that no chain can be longer. Conversely, assume $r$ maximal. Then $\mathfrak p_0=\langle 0\rangle$, so $h_0=0$. Furthermore $\mathfrak p_r$ is maximal, hence $\mathfrak p_r\cap P$ must be maximal too. Hence $h_r=\nu$. Now suppose there is $i$ such that $h_i+1<h_{i+1}$. Then $(\mathfrak p_i\cap P)\subsetneqq\langle t_1,\dots,t_{h_i+1}\rangle \subsetneqq (\mathfrak p_{i+1}\cap P)$. But $P/(\mathfrak p_i\cap P)$ is equal to $k[t_{h_i+1},\dots,t_\nu]$, which is a normal ring. As furthermore the extension $P/(\mathfrak p_i\cap P)\hookrightarrow A/{\mathfrak p_i}$ must be integral as $P\subset A$ is, Going-down yields a prime $\mathfrak p$ between $\mathfrak p_i$ and $\mathfrak p_{i+1}$ such that $\mathfrak p\cap P=\langle t_1,\dots,t_{h_i+1}\rangle$. Then $\mathfrak p_i\subsetneqq \mathfrak p\subsetneqq \mathfrak p_{i+1}$ which contradicts the maximality assumption of $r$. Hence $h_i+1=h_{i+1}$ for all $i$, which implies $r=h_r=\nu$.
Now you can prove your formula quite easily: Pick a maximal chain $\mathfrak p_0\subsetneqq \dots\subsetneqq \mathfrak p\subsetneqq\dots\subsetneqq \mathfrak p_n$ in $A$ (which is possible by the above proposition and has length $\dim (A)$), then $\mathfrak p_0A_{\mathfrak p}\subsetneqq \dots\subsetneqq \mathfrak pA_{\mathfrak p}$ is a maximal chain in $A_{\mathfrak p}$ and $\mathfrak p/\mathfrak p\subsetneqq \dots\subsetneqq \mathfrak p_n/\mathfrak p$ is a maximal chain in $A/\mathfrak p$ and since every such chain in $A$ can be constructed from two chains in $A_{\mathfrak p}$ and $A/\mathfrak p$, respectively, we see that the lengths of both chains must be the dimension of both rings.