Contact planning for legged robots in extremely constrained environments is challenging. The main difficulty stems from the mixed nature of the problem, discrete search together with continuous trajectory optimization. To speed up the discrete search problem, we propose in this paper to learn the properties of transitions from one contact mode to the next. In particular, we learn a feasibility classifier and an offset network; the former predicts if a potential next contact state is feasible from the current contact state, while the latter learns to compensate for misalignment in achieving a desired contact state due to imperfections of the low-level control. We integrate these learned networks in a Monte Carlo Tree Search (MCTS) contact planner to better prune the tree and improve the heuristic. Our simulation results demonstrate that training these networks with offline data significantly speeds up the online search process and improves its accuracy.