The graph editor has two parts (outliner and graph), so there is a difference between selecting the attribute (channel) in the Graph Editor and selecting the animation curve in the Graph Editor.
This code returns what is highlighted in the Graph Editor outliner, which controls what you curves you will see in the Graph.
CODE
selectionConnection -q -object outlinerEditor -q -slc graphEditor1OutlineEd
;
This code returns the actual selected curve in the graph, in which case you'll need to chase down it's connection to find the atrribute (channel) it is connected to.
CODE
keyframe -q -sl -name;
or
selectionConnection -q -object outlinerEditor -q -hlc graphEditor1OutlineEd
;
So the answer is it depends on what you mean by "which channels are selected in the Graph editor?". What attributes are selected in the graph editor outliner or what curve is selected in the graph editor graph?