Let me assume that the theory of $L$ is an element of $L$. This happens, for example, if $L_\alpha\prec L$ for some ordinal $\alpha$, because in this case the theory of $L$ is the same as the theory of $L_\alpha$, which is an element of $L$. Let $t$ be the theory of $L$, which is (coded by) a real in $L$. This real is therefore the $\alpha^{th}$ real in the $L$-order, and in order to define the theory $t$, it will suffice to define the ordinal $\alpha$.
Let $L[G]$ be a forcing extension of $L$ forcing to collapse $\aleph_{\alpha}^L$ to $\omega$. So in $L[G]$, the true $\omega_1$ is the same as $\omega_{\alpha+1}^L$, and we can determine this inside $H_{\omega_1}$. In that structure, we can define the class of ordinals that are cardinals in $L$, and there will be exactly $\alpha$ of them.
This makes the theory of $L$ definable inside $V=L[G]$ by a formula quantifying only over reals, and it will be $\Delta^1_n$ for some smallish $n$.
Let's try to find out how complex the definition is. My proposed definition is that in $V=L[G]$, the theory of $L$ is the theory coded by the real $t$ which is the $\alpha^{th}$ real in the $L$ order, where $\alpha$ is the number of infinite $L$-cardinals that are countable in $V$.
So, $t$ is as desired if there is a countable transitive model $L_\beta$ that thinks $t$ is the $\alpha^{th}$ real and which has exactly $\alpha$-many infinite cardinals, which do not get collapsed in any larger countable transitive $L_\gamma$, whereas all larger countable ordinals above those ordinals do get collapsed in some larger $L_\gamma$.
What is the complexity? It looks to be $\Sigma^1_4$, but I might be mistaken.