For lifting, the most important function of abdominal strength is to provide intra-abdominal pressure to counteract sheer and compressional forces on the lumbar spine. This is performed primarily by the transversus abdominus, the diaphragm, and the pelvic floor complex (sometimes known as the pelvic diaphragm), and assisted by the rectus abdominis and internal obliques. These muscles collectively form a functional unit that compresses the organs of the abdominal cavity. The three former ones can only be activated through posture and breathing, and they should therefore be trained in conjunction with lifting.
Abdominal pressure is produced through simultaneous contraction of the three major muscle groups—transversus abdominis, diaphragm, and pelvic diaphragm—which push inward, downward, and upward, respectively. Without cooperation from all of them, the potential for intra-abdominal pressure is limited. Hence, our objective should be to ensure that they are all engaged during our lifts.
In order to activate these ‘core’ muscles maximally, the spine must remain in a ‘neutral’ position. Hold a tall and erect posture before commencing. This aligns the spine and engages the transversus abdominis and pelvic diaphragm. (The abdominals should reflexively tighten and draw inward, and the muscles of the pelvic floor should contract discernibly.) Draw a breath in, relaxing the abdominals to allow for full and natural expansion of the lungs. (The belly should rise, not the chest.) Then, holding the breath, draw the abdominals forcedly towards the spine before commencing the squat or deadlift. Force your breath against a closed glottis at the beginning of the concentric phase, then exhale gradually after passing the most difficult portion or ‘sticking point’ of the lift.
For lower-load and higher-repetition lifts, the breath can be drawn in gradually during the eccentric phase, and forced out gradually from the beginning of the concentric phase. This permits a more continuous and cyclical lift whilst nevertheless approximating the valsalva manoeuvre.
It is important to note that these requirements directly contradict two common lifting practices: hyperextension of the lumbar spine by “lifting the chest”, and forcing the abdominals outwards. Other than disallowing activation of the transversus abdominis, the former increases risk of herniation of the anterior of the annulus fibrosis by loading the intervertebral discs unevenly. And the latter limits the amount of intra-abdominal pressure that can be developed.
Lifting, itself, can be supplemented with isometric training of the rectus abdominus and internal obliques, which support the transversus abdominis in resisting and hence maintaining intra-abdominal pressure. Bridges, roll-outs, straight-arm pull-downs, hanging leg raises, or any other similar movement in which the spine is loaded in its neutral position are all good choices.
I hope that is helpful.