Robert Virding also has some great talks but I can't find the specific one where he discusses some of the lesser known compilation steps. At the end of the day, I learned the most from reading Erlang source code though. There's a lot to see in the Core Erlang compilation code: https://github.com/erlang/otp/tree/maint/lib/compiler/src
As to answer some questions elsewhere in this discussion on why BEAM code isn't targeted directly, it is poorly documented but you also lose out on a lot of these optimizations which happen at the Core Erlang stage. These are all things you'll have to reinvent.
There is debate on whether Core Erlang is a better target than Erlang but I'll skip that debate for now. Some languages, like Elixir target Erlang AST structures rather than Core Erlang while others (LFE) target Core Erlang.