A line officer is a sub/surface officer. You would be an Unrestricted Line Officer which means you essentially can be used in any billet within your community at sea and are eligible to succeed to command, which means you are able to be a Commanding Officer of a warship. (That would usually take over 20 years of being an officer or your entire chain of command above you being killed all at once.) For your eligibility, they would probably look at your overall GPA and the specific grades you got in your technical classes with an emphasis on Math/Physics/Thermo/Chemistry. Your grades in non-technical classes will probably be ignored for the most part unless you did really poorly in them. I don't know the specifics of what exactly they look at or how much transferring schools would help you. I wouldn't transfer schools just to be more competitive for NUPOC unless you were already planning on transferring to be more competitive in general. I would recommend talking with a NUPOC recruiter for more specific advice.
Also, if you haven't checked out it yet I would recommend browsing
https://nupocaccessions.blogspot.com/ You can send the site admin an email with your questions and he should be able to give you the best advice. I went through the NUPOC pipeline 7 years ago, so your experience might be different than mine.
Also, I know my college had a freshman forgiveness program where if you did poorly in a class your first year, you could retake it and your original grade would be removed from your record if you did better. Ask your school if they do anything like that or if you could retake any of your classes you originally did poorly in to get a better grade (especially Math/Physics classes). They might not discount the original grade, but they might add the new grade into your GPA and it would be something more to show NR that you got your s**t together and that you're willing to go the extra step to rectify past mistakes. But before you do any of that, talk to a NUPOC recruiter.