|   | 1 |  initial version  | 
You can look at the is_similar method for matrices, see this page for the documentation and examples.
You can get the transformation matrix A by setting the transformation parameter to True. Note that, since you are working with integer matrices, the transformation matrix will be in the algebraic field QQbar, you can get it back to ZZ as follows:
sage: A = X.is_similar(Y, transformation=True)[1].change_ring(ZZ)
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.