What is the purpose of k in the transitive closure method?
One way you can think about the transitive closure method of converting DFAs to regular expressions (suggested by Michael Sipser in "Introduction to the Theory of Computation") is to think about converting a DFA to a regular expression by progressively ripping out states from the DFA and replacing transitions into and out of that state with new transitions labeled with regular expressions that have the same effect as entering and leaving the state.  Once you have ripped out a sufficiently large number of states, you can directly read off the regular expression from the resulting automaton.

$k$ in this algorithm is used to indicate what states you have eliminated so far.  You number all of the states $1, 2, 3, ..., n$, then use $k$ to indicate the numbers of all states you have eliminated at a particular point.  First you eliminate state 1; then states 1 and 2; then states 1, 2, and 3; etc.  Once you have $k = n$, you've eliminated all states and can just read off the answer.

If you'd like a graphical presentation of how this works, I have a set of lecture slides I used when teaching this construction.  It doesn't formally specify the algorithm or prove correctness, but should give you a visual representation of what the algorithm is doing.

Hope this helps!