Here is a formalization or detailed exposition of Asaf Karagila's answer.
Because $A \times B$ is r.e., there is an $e$ such that for all $n$ and $m$,
$$
(n,m) \in A \times B \Leftrightarrow (\exists s)T(\underline{e},\underline{\langle n,m\rangle},s).
$$
Here $T$ is Kleene's $T$ predicate, $\underline{x}$ is the numeral for a number $x$, and $\langle \cdot,\cdot\rangle$ is a fixed effective pairing operation, e.g. $\langle n,m \rangle = 2^n3^m$.
Given $e$, we can define a unary computable function $f(n)$ which does the following: search for an $m$ and $s$ such that $T(\underline{e},\underline{\langle n,m\rangle},\underline{s})$ holds. If such an $m$ and $s$ are found, immediately halt and return $1$, otherwise keep searching forever.
Because $f$ is computable, it has an index $e'$. Then we have, for all $n$,
$$
n \in A \leftrightarrow (\exists s) T(\underline{e'},\underline{n},s)
$$
and so the formula on the right side of that equivalence is the desired formula. In particular, we can effectively produce $e'$ from $e$.
As a historical note, this argument is reminiscent of the way that arguments in computability were written in the earliest stages of the field, in the 1940s and 1950s. As the field progressed, we have stopped using this sort of argument - which needlessly brings up technical devices such as the $T$ predicate - and have moved to more intuitive arguments like the ones William and A.Schulz provided, which do not explicitly mention formulas. It is occasionally necessary to work with the $T$ predicate, especially when studying formal theories of arithmetic, but for pure computability theory it is not typical to write arguments in this style.