The module "animal" exclusively exports the package animal.behavior to module dog. The "requires transitive" won't re-export this package to modules requiring module dog.
https://docs.oracle.com/javase/specs/jls/se12/html/jls-7.html#jls-7.7.2
"If an exports or opens directive has a to clause, then the directive is qualified; otherwise, it is unqualified. For a qualified directive, the public and protected types in the package, and their public and protected members, are accessible solely to code in the modules specified in the to clause."
Thus, to make "requires transitive" work, it would be required to remove the "to" clause in animal.