Difference between TaskNode, ActionNode, and TransformationNode?

I am trying to learn more about how Gradle works internally. Looking at the task execution graph, and its executionPlan, I find the nodeMapping, which basically contains data on which tasks will be executed in the current run:

Almost all of the nodes are TaskNodes, but some few are ActionNodes or TransformationNodes, which is consistent with the class hierarchy of Node:

Question: What is the difference between these subtypes, TaskNode, ActionNode, and TransformationNode? What do they mean?
And what would I need to do in my build to cause these other node types to appear in the node mapping?

I am using Gradle 6.6.1, fwiw.

(I made the screenshots using the android-reporting plugin, but that did not help me uncover this secret.) Any insights and maybe even a simple build.gradle paragraph that would cause these nodes to be created are highly appreciated! Pointers to documentation, too, but Google couldn’t find anything. Thanks!!

After much searching, I found that these extra node types come from “artifact transformations” for “variants”. For example, you can have a “variant” with minified artifacts, and define an action for minification, and Gradle will create transformation nodes for it. So that kind of answers the “what does it mean” part.

However, I still don’t see a working example of this. It seems Android is the only user of this feature. I could not find a minimal working example which creates a transformation node and an action node. Even the Gradle docs, which have some fragments of examples, do not contain a working example.

So, an Android-agnostic(!) example which actually compiles would still be greatly appreciated. Thanks!