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.
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.