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.
Let $d_n$ be the number of derangements of $[n]$ (i.e., the number of permutations of $[n]$ with no fixed points). The number of permutations with $k$ fixed points is $\binom{n}kd_{n-k}$: there are $\binom{n}k$ ways to choose the $k$ fixed points, and $d_{n-k}$ derangements of the other $n-k$ points. There are $n!$ permutations altogether, so
$$\sum_k\binom{n}kd_{n-k}=n!\;.$$
Now take the exponential generating function on the lefthand side. To do this, let $$g(x)=\sum_nd_n\frac{x^n}{n!}\;,$$ the exponential generating function for the derangement numbers. We also know that
$$e^x=\sum_n(1)\frac{x^n}{n!}$$
is the exponential generating function for the sequence $\langle 1,1,1,\ldots\rangle$. Now take the convolution of these two exponential generating functions:
$$e^xg(x)=\sum_n\left(\sum_k\binom{n}k(1)d_{n-k}\right)\frac{x^n}{n!}=\sum_n(n!)\frac{x^n}{n!}=\frac1{1-x}\;,$$
so $$g(x)=\frac{e^{-x}}{1-x}\;.$$
Best Answer
Note that the number of permutations of length $n$ with exactly $k$ fixed points is $\binom{n}{k}\mathcal{D}(n-k)$ because there are $\binom{n}{k}$ ways to choose the fixed points and $\mathcal{D}(n-k)$ to arrange the others, where $\mathcal{D}(k)$ is the number of Derangements of $k$ items.
Therefore, the generating function is $$ \begin{align} \overbrace{\sum_{k=0}^n\binom{n}{k}\mathcal{D}(n-k)x^k}^{f_n(x)} &=\sum_{k=0}^n\overbrace{\frac{n!}{k!(n-k)!}\vphantom{\sum_0^k}}^{\binom{n}{k}}\overbrace{\sum_{j=0}^{n-k}(-1)^j\frac{(n-k)!}{j!}}^{\mathcal{D}(n-k)}x^k\tag{1a}\\[6pt] &=n!\!\!\sum_{\substack{j,k\ge0\\j+k\le n}}\!\!\frac{(-1)^j}{j!\,k!}x^k\tag{1b}\\ &=n!\sum_{m=0}^n\sum_{j=0}^m\frac{(-1)^j}{j!\,(m-j)!}x^{m-j}\tag{1c}\\[3pt] &=n!\sum_{m=0}^n\frac1{m!}\sum_{j=0}^m\binom{m}{j}x^{m-j}(-1)^j\tag{1d}\\[3pt] &=\sum_{m=0}^n\frac{n!}{m!}(x-1)^m\tag{1e} \end{align} $$ Explanation:
$\text{(1a)}$: expand $\mathcal{D}(n-k)$ (from $(5)$ in this answer) and $\binom{n}{k}$
$\text{(1b)}$: cancel terms and reindex
$\text{(1c)}$: substitute $m=j+k$
$\text{(1d)}$: multiply and divide by $m!$
$\text{(1e)}$: apply the Binomial Theorem
Thus, for $0\le m\le n$, $$ f^{(m)}(1)=n!\tag2 $$