Hearts captain Danny Wilson is to leave the Scottish Championship title winners at the end of the season.