tf.math.argmax is the tensorflow operations which will allow you to do this. If you have a Keras model you can use a Custom layers, as described in the tutorial: Custom layers  |  TensorFlow Core 1
The final code will look something like:
class IndexOfMaxLayer(tf.keras.layers.Layer):
  def __init__(self):
    super(IndexOfMaxLayer, self).__init__()

  def call(self, inputs):
    return tf.math.argmax(inputs)

Now you can use this code after whichever dense / softmax layer you want to extract the max value from.