format_transition_matrix function

Format transition matrix result with appropriate row and column names