Non-Linear Optimisation

I need some help with optimization. I developed two different black box models (let’s assume I used RandomForest) with inputs xs and outputs ys:

𝑦1 = f(π‘₯_1,π‘₯_2, π‘₯_3, π‘₯_4 … π‘₯_𝑛,)
𝑦2 = f(π‘₯_1,π‘₯_2, π‘₯_3, π‘₯_4 … π‘₯_𝑛, )
where: y1 and y2 are different outputs,
and x are inputs.

I want to optimize y1 and y2 with constraints (assume optimization using a genetic algorithm). Please, how do I do this?

Note: y1 and y2 have a nonlinear relationship to the inputs (i.e no linear objective function)