Installation profile - Can I create nodes via yml files? What's the best practice for it?
That's exactly what the Default content module was built for:


  Default content gives your module and install profile a way to ship default content as well as configuration.


I'm not sure it supports YAML, but definitely JSON and others, so it's basically the same thing.

The docs can be found here.