It appears this can't be done, because the code below still renders HTML elements, they are just empty.
<jdoc:include type="message" />
The solution is therefor to purely use the classes generated by Joomla. It is not ideal, and for me has meant doing the same thing twice in my template. For reference the code that is outputted is:
<div id="system-message-container">
<div id="system-message">
<div class="alert alert-warning">
<a class="close" data-dismiss="alert"> [cross to close] </a>
<h4 class="alert-heading"> [heading] </h4>
<div> [message] </div>
</div>
</div>