Your character will gain experience for most actions, such as encountering other ships, completing contracts, etc. More experience is awarded for dangerous activities, eg you will get more experience for destroying another ship than for acknowledging it. You will NOT earn experience for exploring or harvesting.
Character Level = [(Quickness + Wisdom + Charisma + Negotiate + 2x Stealth + Intimidate + Pilot + Explorer + Warrior + Tactics - 50) / 6) + 1]
Skill cost = 3 + Level / 7
Attribute cost = 6 + Level / 5
Because Level is skill / attribute based (not total XP) the "Level" can be different based on how the XP is spent, in what order and in what concentrations. Therefore, depending on the character's build, Level 50 can be reached with a range of at least +/- 500XP based on the strategies.