First off: a generatrix is a line lying fully within the cone (i.e. its surface, not the space it encloses). It has to pass through the vertex. (There might be degenerate cases where this definition is not as clear, e.g. if the cone decomposes into a pair of planes, but I'm not sure you'd even call that a cone.)
My background is projective geometry. One way to view that is as the geometry on a plane in 3d space which does not contain the origin, conventionally the plane $z=1$. Everything else in space gets projected through the origin onto that plane, roughly speaking.
Assume that the common vertex of your cones is the origin. This is a condition you can easily achieve using a suitable translation. Then a line on one of the cones, a generatrix, corresponds to a line through the origin, which represents a single point in projective geometry. The visible location of that point is where the line intersects the plane $z=1$. If you repeat the same for all the lines on the cone, you get the whole cone in space, and the figure on the plane will be a conic section.
Which leads me to the core of this post: Your question is equivalent to that of finding the (up to four) points of intersection of a pair of conic sections (or quadrics). In another answer I wrote instructions on how to compute these points of intersection. Connecting any of them to the origin will lead to a line shared by both your cones. Depending on how your cones are located, you might get fewer than four real and distinct solutions.
If your vertex is at $(0,0,0)$ then you can describe each cone as the set of points satisfying $ax^2+by^2+cz^2+dxy+exz+fyz=0$ or equivalently in matrix notation
This is the matrix representation I'm using in that other answer. The fact that I think about it as representing points on the plane $z=1$ is of no practical relevance: in the end you get a set of (up to) four three-element vectors, which in my question were interpreted as homogeneous coordinates of a point, but in your setup are the direction vectors of lines.
Actually the above is true for a double cone, i.e. with a line as the generatrix. If you have a single cone, with a ray as the generatrix, then the formula needs some additional condition to select one half, and some of the resulting points of intersection of the planar conics might correspond to a pair of opposite rays for the cones, not leading to a shared generatrix.