I found this on Michael Spivak calculus, in the Taylor series chapter (see picture above) :
The following formula $a_k = \frac{p^{(k)}(a)}{k!}$ is found from an hypothetical polynomial function $p(x) = a_0 + a_1(x-a) + ... + a_n(x-a)^n$, derivated n times on $a$.
But what is obscure for me, is the fact that we use this formula (now under the form of $a_k = \frac{f^{(k)}(a)}{k!}$), to compute some coefficients for usual functions.
Suppose that $f$ is a function (not necessarily a polynomial)
This is notably with this formula that the coefficients will be computed for $sin(x)$ (cf next picture).
What is the trick of calculating coefficient from a polynomial function, then apply it in the context of an usual function, and then reinsert computed coefficients in the polynomial function ?
I don't really understand how we can find this result, is this simply an empiric discovery ?

Think of it as trying to construct a polynomial approximation for a given function. Suppose we have a non-polynomial function $f(x)$ (e.g. $\sin(x)$). Now let's try to approximate with a polynomial, the most natural form being $$f(x) \approx a_0 + a_1 x + ... + a_n x^n$$
But to use this polynomial approximation, we need to determine the coefficients. $a_0$ is easy, as if we plug $0$ in the function, then we can say, $$f(0) \approx a_0$$
Assuming we know how to evaluate $f$ at any point, we can then reverse this condition to instead choose $a_0$ as, $$a_0 \equiv f(0) $$
We could technically get the other coefficients by evaluating $f$ at other points and solving a linear system of equations. But this polynomial structure of the approximating function has an easier method. If we differentiate the approximation, $$f^{(1)}(x) \approx a_1 + 2 a_2 x ... + n a_n x^{n-1}$$
So like before, we can choose $a_1$ as, $$a_1 \equiv f^{(1)}(0)$$
Repeating this process for the remaining coefficients, we get the general formula of, $$a_k \equiv \frac{f^{(k)}(0)}{k!}$$
And so, now that we have determined all the coefficients, we have our polynomial approximation. The $(x-a)$ form gives the benefit of evaluating $f$ and its derivatives at a point $a$ which need not be $0$.