There are some general methods for solving or deciding transcendental equations in closed form. "Closed form" means expressions of allowed functions (Wikipedia: Closed-form expression). If an equation is solvable in closed form depends therefore on the functions you allow.
a) Allow algebraic numbers as closed form:
At first you can look if the equation can have an algebraic number as solution. In an equation $f(x)=0$, the right-hand side, $0$, is an algebraic number. The left-hand side, $f(x)$, has to be therefore also an algebraic number. Look for which algebraic arguments the transcendental function $f$ can have algebraic function values.
Your first example $cos(\pi x)+x^{2}=0$: $x^{2}$ is algebraic if $x$ is algebraic. $cos(\pi x)$ is algebraic if $x$ is rational.
Your second example $x\tan(x)-a=0$, if $a$ is an algebraic number: Assume $x$ to be algebraic. $\tan(x)$ is algebraic only if $x=0$. Therefore the only algebraic solution of the equation could be $x=0$, if $0$ would be a solution.
b) Allow the members of a given class of certain functions as closed form:
A general method for solving a given equation $f(x)=0$ is to apply the compositional inverse $f^{-1}$ of $f$: $x=f^{-1}(0)$. In general, $f$ and $f^{-1}$ are correspondences. But often it is possible to split the problem into subproblems where $f$ and $f^{-1}$ are functions.
For applying this method, $f$ and $f^{-1}$ have to be known. That means they have to be in closed form.
There is a general method for the elementary functions.
The elementary functions are according to Liouville and Ritt those functions of one variable which are obtained in a finite number of steps by performing algebraic operations and taking exponentials and logarithms (Wikipedia: Elementary function).
The incomprehensibly unfortunately hardly noticed theorem of Joseph Fels Ritt in [Ritt 1925] Ritt, J. F.: Elementary functions and their inverses. Trans. Amer. Math. Soc. 27 (1925) (1) 68-90 answers which kinds of Elementary functions can have an inverse which is an Elementary function. You can also take the method of
Rosenlicht, M.: On the explicit solvability of certain transcendental equations. Publications mathématiques de l'IHÉS 36 (1969) 15-22.
It is easy to prove a theorem that is in a certain sense opposite to Ritt's theorem: If $f$ is a function with $f=f_1\circ\ldots\circ f_n$, where $n\in\mathbb{N}_{\ge 1}$ and $\forall i\in\{1,...n\}\colon f_i\colon D_i\subseteq\mathbb{C}^{k_i}\to\mathbb{C}^{k_i}$, for each partial inverse $\phi$ of $f$, $\phi=\phi_n\circ\ldots\circ \phi_1$ holds, where $\forall i\in\{1,...n\}\colon \phi_i$ is a partial inverse of $f_i$.
Lin and Chow present some kinds of transcendental equations that are not solvable by elementary numbers.
[Chow 1999] Chow, T.: What is a closed-form number. Am. Math. Monthly 106 (1999) (5) 440-448
[Lin 1983] Ferng-Ching Lin: Schanuel's Conjecture Implies Ritt's Conjectures. Chin. J. Math. 11 (1983) (1) 41-50
If $f$ can be decomposed into compositions of algebraic functions and other known Standard functions than $\exp$ and $\ln$, an analog theorem to the theorem of Ritt of [Ritt 1925] could be applied. I hope to prove such a generalization of Ritt's theorem for this class of functions.