Rotate an object from the orientation of another object's vectors.

I’m looking for a way to rotate an object from the orientation of another object’s vectors. In this situation, I have two cubes, one on top of the other, the upper one being the child of the lower one.

But the upper cube has any Y rotation:

What I want is to rotate the child cube in the transform.right direction of the parent cube, keeping the original rotation of the child, without adding more objects to the hierarchy. Any ideas?
It’s a little confusing, but I try to clarify it better if I’m not.

I am a little confused as to what exactly you are trying to do, but I recommend checking out Transform.RotateAround Unity - Scripting API: Transform.RotateAround
**
You can use this to rotate around any axis you want. So if you wanted to rotate about the another cube’s right axis, passing through the center of your object you could call transform.RotateAround(transform.position, other.transform.right, amount);