She got into the habit of getting up early.

Literal

She [topic-は] early-rising [genitive-の] habit [subject-が] became-attached.

習慣がつく ('a habit forms / takes hold,' lit. 'a habit attaches') is the standard frame for 'develop a habit / get into the habit.' The transitive partner 習慣をつける would mean 'establish a habit deliberately.' 早起きの習慣 uses の to attach 早起き ('early rising') as a modifier of 習慣 ('habit'). The structure is the inchoative inverse of the deliberate-cultivation version — habit emerged organically, not by design.