Hello and welcome to JustAnswer!
The first step in diagnosing the problem will be to use a scan tool to see what codes are setting in the ABS module. The lights are coming on because the module is seeing an issue in a monitored system or component and sets a fault code.
Since the speedometer stops at the same time the lights come on it's very likely that you have a speed sensor issue, whether it's the sensor or wiring. It's also possible that the module itself is going down either because of an internal failure or loss of power or ground.
If the ABS lights have gone out but the engine light has stayed on then there may be more than one problem. The engine light should go away within a few trips of the ABS light. If not then there may be another unrelated problem, reading the fault codes from the engine controller would tell you if there is another issue or not.