How do I convert fluorescent cans to LED?
I believe that the electrical connection you are seeing is from the ballast ( the thing that Makes the fluorescent tube light) that is wired into the other metal box part of the Can. You would need to remove that ballast to put in another type of light in. It would be in the little panel that opens up that I can see in the 2nd Picture. In that box there should be the main electrical wire that is feeding the ballast then the ballast has 4 wires coming out. You would want to remove it and then have a White and Black go back though that flex.   Though your stumbling block there might be how to mount the new LED Trim to the Existing housing. 

Do you have room in the attic to see the Cans? It might be easier to replace the can from the Attic with a new Can (they are less then $10)