The answer to your question is in the docs and the source code.
To answer your question more generally, you'll want to look up the function you applied in the docs. There, package authors usually cite their sources. With the function name (and a bit of knowledge about how R works), you can also track down the function in the repo, to see exactly how that formula is applied.
You can see the CRAN package site for fpp2 here, CRAN - Package fpp2
From that, you can see the repository for this package is located at
And the package documentation is located at
Now, specific to fpp2 and forecasting, you're fortunate enough to have a package written by Rob Hyndman. He and George Athanasopoulos wrote a free book on forecasting to accompany this package.