Typically you would implement the utility function directly. In this case, the algorithm would not learn how to play the game, it would use the information that you had explicitly hard-coded in the implementation.
The MINMAX algorithm returns the minimax decision from the current state, i.e, it optimizes the "worst-case outcome" for MAX. MINIMAX_VALUES for a node is defined as the minimum of the utility functions(Utility Function is a Numeric value given to terminal states. For example, in tic-tac-toe, win = +1, loss = -1 and draw = 0.) of the successors if the ply is of the MIN player and maximum value of the utility functions of the successor if the ply is of the MAX player. The MINIMAX_VALUES for all of the nodes are calculated and the node with the highest value is chosen as the best move.
Minimax is a decision rule used in Artificial Intelligence so if you wish to learn more about Minimax Decision Rule then visit this Artificial Intelligence Course.