Tsai Ing-wen rode a tide of discontent over everything from China ties to economic growth to become the island’s first female president and secure a historic legislative majority for her Democratic Progressive Party.