I couldn't stop coughing on the train and I felt bad because everyone was staring at me.
I just kept coughing and coughing on the train and felt a little self-conscious because it felt like people were looking at me.
この場合、次のような言い方ができますよ。
ーI couldn't stop coughing on the train and I felt bad because everyone was staring at me.
「電車で咳が止まらなくて、みんなにジロジロ見られて困った」
to cough「咳をする」
to stare at ...「ジロジロ見る」
ーI just kept coughing and coughing on the train and felt a little self-conscious because it felt like people were looking at me.
「電車で咳が止まらなくて、みんなに見られているようでちょっと気にしてしまった」
self-conscious「人目を気にする」
ご参考まで!