You gain both skill lines as you gain AP, or Alliance Points. You get these from killing players, capturing/defending keeps and resources and doing the quests. At the beginning the skill line increases faster, then it slows down by a lot. Same goes for your Alliance Rank, which also increases through AP.
You might want to consider getting an addon (if PC) that shows you how much AP you are gaining: usually all xp tracking addons also track ap. In time, you'll learn how to be more AP effective in your playtime.