Unable to contain my curiosity, I couldn't help but ask the student right in front of me.

Literal

Bothered-and-unbearable I [topic-は] involuntarily, in-front-of [possessive-の] student [to-に] ended-up-asking.

~てならない ('can't help but feel X') intensifies the preceding feeling to an uncontrollable degree — here, 気になる 'to be bothered/curious' + ならない = 'so curious I can't stand it.' 思わず is an adverb meaning 'involuntarily, without thinking,' and ~てしまった on 聞く signals that the asking was unintended or regrettable. The whole sentence stacks three markers of uncontrollable action: the irresistible feeling, the involuntary reaction, and the regretted result.