As you can see at https://learn.microsoft.com/en-us/vsts/package/overview and https://learn.microsoft.com/en-us/vsts/package/get-started-maven, you need at least TFS 2018 for Maven package repository being available and additionally you have to have Package Management installed and licensed (or in trial mode) and additionally the TFS admin has to enable "Maven for Package Management" in the "Preview Features" section of the settings.
If all this is given, you can create a feed for Maven package management and then you can use the maven
or maven-publish
Gradle plugin to publish to that TFS feed you created. https://learn.microsoft.com/en-us/vsts/package/get-started-maven should give you an indication on what settings you need to publish to configure the respective Gradle plugin.
As I don't have TFS available, I cannot give you a concrete example.