It seems to be increasingly common in 2019 that people are using the tactic of redirecting expired domains in order to boost the rankings of their “money” (main) website.
Google are traditionally anti-link-building so it’s important not to take everything they say with a grain of salt but here’s John Mueller’s response to this specific question.
Note that this was asked in the context of building “spammy” links to the domain that will then 301 redirect to a main site.
The 301 basically makes the main site canonical, meaning the links go directly there. You might as well skip the detour [as] it’s just as obvious to the algorithms annd spam team.
I would have to imagine that Google are not too strict with this.
After all, anyone can redirect any domain they own to your website and then point bad links at it. Unless you leave some obvious footprint, it’s very hard to know exactly who set-up the redirect in the first place.
That said, any form of link building can result in a penalty so it’s something to be careful about and wary of ahead of time.