Relatively Anosov representations via flows I: theory