Let $f(n,k)$ count the number of permutations in $S_n$ with exactly $k-1$ ascents. I claim that $$\tag 1 f(n,k)=(n-k+1) f(n-1,k-1)+k f(n-1,k)$$
If we prove this, putting $k=2$ gives $f(n,2)=n-1+2 f(n-1,2)$, i.e. if $x_n$ denotes the number of permutations of $n$ with exactly one ascent, $x_n-2x_{n-1}=n-1$. This then can be used to prove the formula say by induction, or by using generating functions. Se let's try to prove $(1)$.
Suppose we have a permutation of $n-1$ letters with $k-1$ ascents. Picture it as $k$ monotone blocks $B_1,\ldots,B_k$. Then we may introduce $n$ in exactly $k$ ways such that no ascent is added, namely first in each of the $k$ blocks. Now suppose we have a permutation of $n-1$ letters with $k-2$ ascents. Then we may introduce $n$ in $n-k+1$ ways to add exactly one ascent, namely after any element of each of the $k-1$ blocks that is not the leading element.
In the first case, we're obtaining in a permutation in $S_n$ where $n$ is placed in the string $\dots a_i n a_{i+1}\dots$ with $a_i<a_{i+1}$. In the second case, we're obtaining a permutation where $n$ is placed in the string $\dots a_i na_{i+1}\dots$ and $a_i > a_{i+1}$. These are the only two possible cases we face when looking at a permutation, the above simply observes we're splitting $S_n$ into this two cases, noting each fiber in the surjection has exactly $k$ or $n-k+1$ elements, which proves the claim.
There are two possible interpretations here, the first, permutations
consisting of an even number of odd cycles and some even cycles and
second, permutations consisting of an even number of odd cycles only.
First interpretation.
Observe that the generating function of permutations with odd cycles
marked is
$$G(z, u) =
\exp\left(\sum_{k\ge 1} \frac{z^{2k}}{2k}
+ u \sum_{k\ge 0}\frac{z^{2k+1}}{2k+1}\right).$$
This is
$$G(z, u) =
\exp\left((1-u)\sum_{k\ge 1} \frac{z^{2k}}{2k}
+ u \sum_{k\ge 1}\frac{z^{k}}{k}\right).$$
To get the permutations with an even number of odd cycles use
$$\frac{1}{2} G(z,1)+\frac{1}{2} G(z, -1)$$
which yields
$$\frac{1}{2}\exp\left(\sum_{k\ge 1}\frac{z^{k}}{k}\right)
+ \frac{1}{2} \exp\left(2\sum_{k\ge 1} \frac{z^{2k}}{2k}
- \sum_{k\ge 1}\frac{z^{k}}{k}\right).$$
This simplifies to
$$\frac{1}{2} \frac{1}{1-z}
+ \frac{1}{2} (1-z) \frac{1}{1-z^2}$$
which is
$$\frac{1}{2} \frac{1}{1-z}
+ \frac{1}{2} \frac{1}{1+z}.$$
This simply says that when $n$ is even then there must be an even
number of odd cycles and when $n$ is odd there cannot be an even
number of odd cycles, which follows by inspection (parity).
Second interpretation.
Here we have
$$G(z, u) =
\exp\left(u \sum_{k\ge 0}\frac{z^{2k+1}}{2k+1}\right).$$
This is
$$G(z, u) =
\exp\left(u \sum_{k\ge 0}\frac{z^{k}}{k}
- u \sum_{k\ge 1}\frac{z^{2k}}{2k}\right).$$
To get the permutations with an even number of odd cycles use
$$\frac{1}{2} G(z,1)+\frac{1}{2} G(z, -1)$$
which yields
$$\frac{1}{2}\frac{1}{1-z}
\left(\frac{1}{1-z^2}\right)^{-1/2}
+ \frac{1}{2} (1-z)
\left(\frac{1}{1-z^2}\right)^{1/2}.$$
This gives the sequence
$$0, 1, 0, 9, 0, 225, 0, 11025, 0, 893025, 0,
108056025, 0, 18261468225,\ldots$$
which points us to
OEIS A177145,
where we find this computation confirmed.
This generating function maybe written as
$$\frac{1}{2}\frac{1}{1-z}
\sqrt{1-z^2}
+ \frac{1}{2} (1-z)
\frac{1}{\sqrt{1-z^2}}$$
or
$$\frac{1}{2}\sqrt{\frac{1+z}{1-z}}
+ \frac{1}{2}\sqrt{\frac{1-z}{1+z}}.$$
Best Answer
This is a long story, hard to tell succinctly. Try reading the beginning of Analytic Combinatorics by Flajolet and Sedgewick or Combinatorial Species and Tree-like Structures by Bergeron, Labelle, and Leroux. One way or another you'll arrive at a substantially more general result, which is a version of what's called the "exponential formula," and which concisely expresses in generating function form the decomposition of a permutation into cycles; see, for example, this blog post. This formula asserts that
$$\exp \left( \sum_{k \ge 1} z_k \frac{t^k}{k} \right) = \sum_{n \ge 0} \left( \sum_{\pi \in S_n} \prod_{i=1}^n z_i^{c_i(\pi)} \right) \frac{t^n}{n!}$$
where $c_i(\pi)$ denotes the number of cycles of length $i$. You can learn a lot of things from this generating function by substituting things for the $z_k$. For example, it follows that the EGF of permutations whose cycle lengths are constrained to lie in some subset $S \subseteq \mathbb{N}$ is
$$\exp \left( \sum_{k \in S} \frac{t^k}{k} \right)$$
which is already a substantial generalization of your claim. But there is even more information hidden in this generating function; for example, it implies that the distribution of the number of $i$-cycles in a random permutation of size $n$, as $n \to \infty$, approaches a Poisson distribution with mean $\frac{1}{i}$.
In any case, the generating function you're interested in can be written somewhat more explicitly as follows. Note that $\sum_{k \ge 1} \frac{t^k}{k} = \log \left( \frac{1}{1 - t} \right)$. We can isolate the odd terms using the general fact that if $f(t)$ is a power series then its odd terms are given by $\frac{f(t) - f(-t)}{2}$, hence we want
$$\sum_{k \ge 0} \frac{t^{2k+1}}{2k+1} = \frac{1}{2} \left( \log \left( \frac{1}{1 - t} \right) - \log \left( \frac{1}{1 + t} \right) \right) = \frac{1}{2} \log \frac{1 + t}{1 - t}$$
and exponentiating both sides gives
$$\boxed{ O(t) = \exp \left( \sum_{k \ge 0} \frac{t^{2k+1}}{2k+1} \right) = \sqrt{ \frac{1 + t}{1 - t} } }.$$
From here we can extract a closed formula for the number $o_n$ of permutations with odd cycles as follows. First let's consider the analogous problem for permutations consisting of only even cycles; this corresponds to adding rather than subtracting to isolate even terms which gives
$$\boxed{ E(t) = \exp \left( \sum_{k \ge 1} \frac{t^{2k}}{2k} \right) = \frac{1}{\sqrt{1 - t^2}} }$$
and so, using the identity $\frac{1}{\sqrt{1 - 4t}} = \sum_{n \ge 0} {2n \choose n} t^n$, we conclude that the number $e_n$ of permutations of $n$ elements with only even cycles satisfies
$$\boxed{ e_{2k} = \frac{(2k)!}{2^{2k}} {2k \choose k} = \left( \frac{(2k)!}{2^k k!} \right)^2 = (2k-1)!!^2 }$$
where $(2k-1)!! = (2k-1)(2k-3) \dots 1$, and of course $e_{2k+1} = 0$. $e_{2k}$ is A001818 on the OEIS.
Now we can observe that we can rewrite $O(t)$ as
$$\sqrt{ \frac{1 + t}{1 - t} } = \frac{1 + t}{\sqrt{1 - t^2}} = (1 + t) E(t)$$
which gives that $o_{2k} = e_{2k}$ and $o_{2k+1} = (2k+1) e_{2k}$; that is,
$$\boxed{ o_{2k} = (2k-1)!!^2 }$$
and
$$\boxed{ o_{2k+1} = (2k+1) (2k-1)!!^2 }.$$
This is A000246 on the OEIS.